// 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 Signals = Table[
	signalColumns,
	signalIndexes,
	signalForeignKeys,
	signalUniques,
	signalChecks,
]{
	Schema: "",
	Name:   "signal",
	Columns: signalColumns{
		Addressed: column{
			Name:      "addressed",
			DBType:    "timestamp without time zone",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		Addressor: column{
			Name:      "addressor",
			DBType:    "integer",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			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('signal_id_seq'::regclass)",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		OrganizationID: column{
			Name:      "organization_id",
			DBType:    "integer",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		Species: column{
			Name:      "species",
			DBType:    "public.mosquitospecies",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		Type: column{
			Name:      "type_",
			DBType:    "public.signaltype",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		SiteID: column{
			Name:      "site_id",
			DBType:    "integer",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		Location: column{
			Name:      "location",
			DBType:    "geometry",
			Default:   "",
			Comment:   "",
			Nullable:  false,
			Generated: false,
			AutoIncr:  false,
		},
		FeaturePoolFeatureID: column{
			Name:      "feature_pool_feature_id",
			DBType:    "integer",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
		ReportID: column{
			Name:      "report_id",
			DBType:    "integer",
			Default:   "NULL",
			Comment:   "",
			Nullable:  true,
			Generated: false,
			AutoIncr:  false,
		},
	},
	Indexes: signalIndexes{
		SignalPkey: index{
			Type: "btree",
			Name: "signal_pkey",
			Columns: []indexColumn{
				{
					Name:         "id",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        true,
			Comment:       "",
			NullsFirst:    []bool{false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
		IdxSignalLocation: index{
			Type: "gist",
			Name: "idx_signal_location",
			Columns: []indexColumn{
				{
					Name:         "location",
					Desc:         null.FromCond(false, true),
					IsExpression: false,
				},
			},
			Unique:        false,
			Comment:       "",
			NullsFirst:    []bool{false},
			NullsDistinct: false,
			Where:         "",
			Include:       []string{},
		},
	},
	PrimaryKey: &constraint{
		Name:    "signal_pkey",
		Columns: []string{"id"},
		Comment: "",
	},
	ForeignKeys: signalForeignKeys{
		SignalSignalAddressorFkey: foreignKey{
			constraint: constraint{
				Name:    "signal.signal_addressor_fkey",
				Columns: []string{"addressor"},
				Comment: "",
			},
			ForeignTable:   "user_",
			ForeignColumns: []string{"id"},
		},
		SignalSignalCreatorFkey: foreignKey{
			constraint: constraint{
				Name:    "signal.signal_creator_fkey",
				Columns: []string{"creator"},
				Comment: "",
			},
			ForeignTable:   "user_",
			ForeignColumns: []string{"id"},
		},
		SignalSignalFeaturePoolFeatureIDFkey: foreignKey{
			constraint: constraint{
				Name:    "signal.signal_feature_pool_feature_id_fkey",
				Columns: []string{"feature_pool_feature_id"},
				Comment: "",
			},
			ForeignTable:   "feature_pool",
			ForeignColumns: []string{"feature_id"},
		},
		SignalSignalOrganizationIDFkey: foreignKey{
			constraint: constraint{
				Name:    "signal.signal_organization_id_fkey",
				Columns: []string{"organization_id"},
				Comment: "",
			},
			ForeignTable:   "organization",
			ForeignColumns: []string{"id"},
		},
		SignalSignalReportIDFkey: foreignKey{
			constraint: constraint{
				Name:    "signal.signal_report_id_fkey",
				Columns: []string{"report_id"},
				Comment: "",
			},
			ForeignTable:   "publicreport.report",
			ForeignColumns: []string{"id"},
		},
		SignalSignalSiteIDFkey: foreignKey{
			constraint: constraint{
				Name:    "signal.signal_site_id_fkey",
				Columns: []string{"site_id"},
				Comment: "",
			},
			ForeignTable:   "site",
			ForeignColumns: []string{"id"},
		},
	},

	Checks: signalChecks{
		CheckExclusiveReference: check{
			constraint: constraint{
				Name:    "check_exclusive_reference",
				Columns: []string{"feature_pool_feature_id", "report_id"},
				Comment: "",
			},
			Expression: "((feature_pool_feature_id IS NULL) OR (report_id IS NULL))",
		},
	},
	Comment: "",
}

type signalColumns struct {
	Addressed            column
	Addressor            column
	Created              column
	Creator              column
	ID                   column
	OrganizationID       column
	Species              column
	Type                 column
	SiteID               column
	Location             column
	FeaturePoolFeatureID column
	ReportID             column
}

func (c signalColumns) AsSlice() []column {
	return []column{
		c.Addressed, c.Addressor, c.Created, c.Creator, c.ID, c.OrganizationID, c.Species, c.Type, c.SiteID, c.Location, c.FeaturePoolFeatureID, c.ReportID,
	}
}

type signalIndexes struct {
	SignalPkey        index
	IdxSignalLocation index
}

func (i signalIndexes) AsSlice() []index {
	return []index{
		i.SignalPkey, i.IdxSignalLocation,
	}
}

type signalForeignKeys struct {
	SignalSignalAddressorFkey            foreignKey
	SignalSignalCreatorFkey              foreignKey
	SignalSignalFeaturePoolFeatureIDFkey foreignKey
	SignalSignalOrganizationIDFkey       foreignKey
	SignalSignalReportIDFkey             foreignKey
	SignalSignalSiteIDFkey               foreignKey
}

func (f signalForeignKeys) AsSlice() []foreignKey {
	return []foreignKey{
		f.SignalSignalAddressorFkey, f.SignalSignalCreatorFkey, f.SignalSignalFeaturePoolFeatureIDFkey, f.SignalSignalOrganizationIDFkey, f.SignalSignalReportIDFkey, f.SignalSignalSiteIDFkey,
	}
}

type signalUniques struct{}

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

type signalChecks struct {
	CheckExclusiveReference check
}

func (c signalChecks) AsSlice() []check {
	return []check{
		c.CheckExclusiveReference,
	}
}
