// Code generated by BobGen psql v0.42.5. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.

package dbinfo

import "github.com/aarondl/opt/null"

var Sites = Table[
	siteColumns,
	siteIndexes,
	siteForeignKeys,
	siteUniques,
	siteChecks,
]{
	Schema: "",
	Name:   "site",
	Columns: siteColumns{
		AddressID: column{
			Name:      "address_id",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Created: column{
			Name:      "created",
			DBType:    "timestamp without time zone",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		CreatorID: column{
			Name:      "creator_id",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		FileID: column{
			Name:      "file_id",
			DBType:    "integer",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		ID: column{
			Name:      "id",
			DBType:    "integer",
			Default:   "nextval('site_id_seq'::regclass)",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Notes: column{
			Name:      "notes",
			DBType:    "text",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		OrganizationID: column{
			Name:      "organization_id",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		OwnerName: column{
			Name:      "owner_name",
			DBType:    "text",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		OwnerPhoneE164: column{
			Name:      "owner_phone_e164",
			DBType:    "text",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		ParcelID: column{
			Name:      "parcel_id",
			DBType:    "integer",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		ResidentOwned: column{
			Name:      "resident_owned",
			DBType:    "boolean",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		Tags: column{
			Name:      "tags",
			DBType:    "hstore",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Version: column{
			Name:      "version",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
	},
	Indexes: siteIndexes{
		SitePkey: index{
			Type: "btree",
			Name: "site_pkey",
			Columns: []indexColumn{
				{
					Name:         "id",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        true,
			Comment:       "",
			NullsFirst:    []bool{false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
		SiteAddressIDKey: index{
			Type: "btree",
			Name: "site_address_id_key",
			Columns: []indexColumn{
				{
					Name:         "address_id",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        true,
			Comment:       "",
			NullsFirst:    []bool{false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
		SiteIDVersionUnique: index{
			Type: "btree",
			Name: "site_id_version_unique",
			Columns: []indexColumn{
				{
					Name:         "id",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
				{
					Name:         "version",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        true,
			Comment:       "",
			NullsFirst:    []bool{false, false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
	},
	PrimaryKey: &constraint{
		Name:    "site_pkey",
		Columns: []string{"id"},
		Comment: "",
	},
	ForeignKeys: siteForeignKeys{
		SiteSiteAddressIDFkey: foreignKey{
			constraint: constraint{
				Name:    "site.site_address_id_fkey",
				Columns: []string{"address_id"},
				Comment: "",
			},
			ForeignTable:   "address",
			ForeignColumns: []string{"id"},
		},
		SiteSiteCreatorIDFkey: foreignKey{
			constraint: constraint{
				Name:    "site.site_creator_id_fkey",
				Columns: []string{"creator_id"},
				Comment: "",
			},
			ForeignTable:   "user_",
			ForeignColumns: []string{"id"},
		},
		SiteSiteFileIDFkey: foreignKey{
			constraint: constraint{
				Name:    "site.site_file_id_fkey",
				Columns: []string{"file_id"},
				Comment: "",
			},
			ForeignTable:   "fileupload.file",
			ForeignColumns: []string{"id"},
		},
		SiteSiteParcelIDFkey: foreignKey{
			constraint: constraint{
				Name:    "site.site_parcel_id_fkey",
				Columns: []string{"parcel_id"},
				Comment: "",
			},
			ForeignTable:   "parcel",
			ForeignColumns: []string{"id"},
		},
	},
	Uniques: siteUniques{
		SiteAddressIDKey: constraint{
			Name:    "site_address_id_key",
			Columns: []string{"address_id"},
			Comment: "",
		},
		SiteIDVersionUnique: constraint{
			Name:    "site_id_version_unique",
			Columns: []string{"id", "version"},
			Comment: "",
		},
	},

	Comment: "",
}

type siteColumns struct {
	AddressID      column
	Created        column
	CreatorID      column
	FileID         column
	ID             column
	Notes          column
	OrganizationID column
	OwnerName      column
	OwnerPhoneE164 column
	ParcelID       column
	ResidentOwned  column
	Tags           column
	Version        column
}

func (c siteColumns) AsSlice() []column {
	return []column{
		c.AddressID, c.Created, c.CreatorID, c.FileID, c.ID, c.Notes, c.OrganizationID, c.OwnerName, c.OwnerPhoneE164, c.ParcelID, c.ResidentOwned, c.Tags, c.Version,
	}
}

type siteIndexes struct {
	SitePkey            index
	SiteAddressIDKey    index
	SiteIDVersionUnique index
}

func (i siteIndexes) AsSlice() []index {
	return []index{
		i.SitePkey, i.SiteAddressIDKey, i.SiteIDVersionUnique,
	}
}

type siteForeignKeys struct {
	SiteSiteAddressIDFkey foreignKey
	SiteSiteCreatorIDFkey foreignKey
	SiteSiteFileIDFkey    foreignKey
	SiteSiteParcelIDFkey  foreignKey
}

func (f siteForeignKeys) AsSlice() []foreignKey {
	return []foreignKey{
		f.SiteSiteAddressIDFkey, f.SiteSiteCreatorIDFkey, f.SiteSiteFileIDFkey, f.SiteSiteParcelIDFkey,
	}
}

type siteUniques struct {
	SiteAddressIDKey    constraint
	SiteIDVersionUnique constraint
}

func (u siteUniques) AsSlice() []constraint {
	return []constraint{
		u.SiteAddressIDKey, u.SiteIDVersionUnique,
	}
}

type siteChecks struct{}

func (c siteChecks) AsSlice() []check {
	return []check{}
}
