// 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 Residents = Table[
	residentColumns,
	residentIndexes,
	residentForeignKeys,
	residentUniques,
	residentChecks,
]{
	Schema: "",
	Name:   "resident",
	Columns: residentColumns{
		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,
		},
		Creator: column{
			Name:      "creator",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		ID: column{
			Name:      "id",
			DBType:    "integer",
			Default:   "nextval('resident_id_seq'::regclass)",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Name: column{
			Name:      "name",
			DBType:    "text",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		PhoneMobile: column{
			Name:      "phone_mobile",
			DBType:    "text",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		SiteID: column{
			Name:      "site_id",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
	},
	Indexes: residentIndexes{
		ResidentPkey: index{
			Type: "btree",
			Name: "resident_pkey",
			Columns: []indexColumn{
				{
					Name:         "id",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        true,
			Comment:       "",
			NullsFirst:    []bool{false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
	},
	PrimaryKey: &constraint{
		Name:    "resident_pkey",
		Columns: []string{"id"},
		Comment: "",
	},
	ForeignKeys: residentForeignKeys{
		ResidentResidentAddressIDFkey: foreignKey{
			constraint: constraint{
				Name:    "resident.resident_address_id_fkey",
				Columns: []string{"address_id"},
				Comment: "",
			},
			ForeignTable:   "address",
			ForeignColumns: []string{"id"},
		},
		ResidentResidentCreatorFkey: foreignKey{
			constraint: constraint{
				Name:    "resident.resident_creator_fkey",
				Columns: []string{"creator"},
				Comment: "",
			},
			ForeignTable:   "user_",
			ForeignColumns: []string{"id"},
		},
		ResidentResidentPhoneMobileFkey: foreignKey{
			constraint: constraint{
				Name:    "resident.resident_phone_mobile_fkey",
				Columns: []string{"phone_mobile"},
				Comment: "",
			},
			ForeignTable:   "comms.phone",
			ForeignColumns: []string{"e164"},
		},
		ResidentResidentSiteIDFkey: foreignKey{
			constraint: constraint{
				Name:    "resident.resident_site_id_fkey",
				Columns: []string{"site_id"},
				Comment: "",
			},
			ForeignTable:   "site",
			ForeignColumns: []string{"id"},
		},
	},

	Comment: "",
}

type residentColumns struct {
	AddressID   column
	Created     column
	Creator     column
	ID          column
	Name        column
	PhoneMobile column
	SiteID      column
}

func (c residentColumns) AsSlice() []column {
	return []column{
		c.AddressID, c.Created, c.Creator, c.ID, c.Name, c.PhoneMobile, c.SiteID,
	}
}

type residentIndexes struct {
	ResidentPkey index
}

func (i residentIndexes) AsSlice() []index {
	return []index{
		i.ResidentPkey,
	}
}

type residentForeignKeys struct {
	ResidentResidentAddressIDFkey   foreignKey
	ResidentResidentCreatorFkey     foreignKey
	ResidentResidentPhoneMobileFkey foreignKey
	ResidentResidentSiteIDFkey      foreignKey
}

func (f residentForeignKeys) AsSlice() []foreignKey {
	return []foreignKey{
		f.ResidentResidentAddressIDFkey, f.ResidentResidentCreatorFkey, f.ResidentResidentPhoneMobileFkey, f.ResidentResidentSiteIDFkey,
	}
}

type residentUniques struct{}

func (u residentUniques) AsSlice() []constraint {
	return []constraint{}
}

type residentChecks struct{}

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