// 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 PublicreportNotifyEmailWaterOlds = Table[
	publicreportNotifyEmailWaterOldColumns,
	publicreportNotifyEmailWaterOldIndexes,
	publicreportNotifyEmailWaterOldForeignKeys,
	publicreportNotifyEmailWaterOldUniques,
	publicreportNotifyEmailWaterOldChecks,
]{
	Schema: "publicreport",
	Name:   "notify_email_water_old",
	Columns: publicreportNotifyEmailWaterOldColumns{
		Created: column{
			Name:      "created",
			DBType:    "timestamp without time zone",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Deleted: column{
			Name:      "deleted",
			DBType:    "timestamp without time zone",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		WaterID: column{
			Name:      "water_id",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		EmailAddress: column{
			Name:      "email_address",
			DBType:    "text",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
	},
	Indexes: publicreportNotifyEmailWaterOldIndexes{
		NotifyEmailPoolPkey: index{
			Type: "btree",
			Name: "notify_email_pool_pkey",
			Columns: []indexColumn{
				{
					Name:         "water_id",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
				{
					Name:         "email_address",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        true,
			Comment:       "",
			NullsFirst:    []bool{false, false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
	},
	PrimaryKey: &constraint{
		Name:    "notify_email_pool_pkey",
		Columns: []string{"water_id", "email_address"},
		Comment: "",
	},
	ForeignKeys: publicreportNotifyEmailWaterOldForeignKeys{
		PublicreportNotifyEmailWaterOldNotifyEmailPoolEmailAddressFkey: foreignKey{
			constraint: constraint{
				Name:    "publicreport.notify_email_water_old.notify_email_pool_email_address_fkey",
				Columns: []string{"email_address"},
				Comment: "",
			},
			ForeignTable:   "comms.email_contact",
			ForeignColumns: []string{"address"},
		},
		PublicreportNotifyEmailWaterOldNotifyEmailPoolPoolIDFkey: foreignKey{
			constraint: constraint{
				Name:    "publicreport.notify_email_water_old.notify_email_pool_pool_id_fkey",
				Columns: []string{"water_id"},
				Comment: "",
			},
			ForeignTable:   "publicreport.water_old",
			ForeignColumns: []string{"id"},
		},
	},

	Comment: "",
}

type publicreportNotifyEmailWaterOldColumns struct {
	Created      column
	Deleted      column
	WaterID      column
	EmailAddress column
}

func (c publicreportNotifyEmailWaterOldColumns) AsSlice() []column {
	return []column{
		c.Created, c.Deleted, c.WaterID, c.EmailAddress,
	}
}

type publicreportNotifyEmailWaterOldIndexes struct {
	NotifyEmailPoolPkey index
}

func (i publicreportNotifyEmailWaterOldIndexes) AsSlice() []index {
	return []index{
		i.NotifyEmailPoolPkey,
	}
}

type publicreportNotifyEmailWaterOldForeignKeys struct {
	PublicreportNotifyEmailWaterOldNotifyEmailPoolEmailAddressFkey foreignKey
	PublicreportNotifyEmailWaterOldNotifyEmailPoolPoolIDFkey       foreignKey
}

func (f publicreportNotifyEmailWaterOldForeignKeys) AsSlice() []foreignKey {
	return []foreignKey{
		f.PublicreportNotifyEmailWaterOldNotifyEmailPoolEmailAddressFkey, f.PublicreportNotifyEmailWaterOldNotifyEmailPoolPoolIDFkey,
	}
}

type publicreportNotifyEmailWaterOldUniques struct{}

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

type publicreportNotifyEmailWaterOldChecks struct{}

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