nidus-sync/db/dbinfo/signal.bob.go
Eli Ribble 9b6cacda0e
Make signals include the object they are attached to (pool, report)
This means pushing the types into the common types module, which
required a refactor of a bunch of other libraries.
2026-03-21 01:19:36 +00:00

336 lines
7.8 KiB
Go

// 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,
},
LocationType: column{
Name: "location_type",
DBType: "text",
Default: "GENERATED",
Comment: "",
Nullable: true,
Generated: true,
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{},
},
IdxSignalLocationType: index{
Type: "btree",
Name: "idx_signal_location_type",
Columns: []indexColumn{
{
Name: "location_type",
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))",
},
ValidLocationTypes: check{
constraint: constraint{
Name: "valid_location_types",
Columns: []string{"location_type"},
Comment: "",
},
Expression: "(location_type = ANY (ARRAY['POINT'::text, 'POLYGON'::text, 'MULTIPOLYGON'::text]))",
},
},
Comment: "",
}
type signalColumns struct {
Addressed column
Addressor column
Created column
Creator column
ID column
OrganizationID column
Species column
Type column
SiteID column
Location column
LocationType 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.LocationType, c.FeaturePoolFeatureID, c.ReportID,
}
}
type signalIndexes struct {
SignalPkey index
IdxSignalLocation index
IdxSignalLocationType index
}
func (i signalIndexes) AsSlice() []index {
return []index{
i.SignalPkey, i.IdxSignalLocation, i.IdxSignalLocationType,
}
}
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
ValidLocationTypes check
}
func (c signalChecks) AsSlice() []check {
return []check{
c.CheckExclusiveReference, c.ValidLocationTypes,
}
}