nidus-sync/db/dbinfo/publicreport.nuisance.bob.go
Eli Ribble 1e071d5ce5
Overhaul publicreport storage layer, create unified tables
This is a huge change. I was getting really sick of the split between
nuisance/water tables when more than half of the data they store is
common. I finally bit off the big work of switching it all.

This creates a single unified table, publicreport.report and copies the
existing report data into it. It also ports existing data from the
original tables into the new table.

Along with all of this I also overhauled the system for handling
asynchronous work to use a LISTEN/NOTIFY connection from the database
and a single cache table to avoid ever losing work.
2026-03-18 15:36:20 +00:00

257 lines
5.7 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 PublicreportNuisances = Table[
publicreportNuisanceColumns,
publicreportNuisanceIndexes,
publicreportNuisanceForeignKeys,
publicreportNuisanceUniques,
publicreportNuisanceChecks,
]{
Schema: "publicreport",
Name: "nuisance",
Columns: publicreportNuisanceColumns{
AdditionalInfo: column{
Name: "additional_info",
DBType: "text",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Duration: column{
Name: "duration",
DBType: "publicreport.nuisancedurationtype",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
IsLocationBackyard: column{
Name: "is_location_backyard",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
IsLocationFrontyard: column{
Name: "is_location_frontyard",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
IsLocationGarden: column{
Name: "is_location_garden",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
IsLocationOther: column{
Name: "is_location_other",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
IsLocationPool: column{
Name: "is_location_pool",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
ReportID: column{
Name: "report_id",
DBType: "integer",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
SourceContainer: column{
Name: "source_container",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
SourceDescription: column{
Name: "source_description",
DBType: "text",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
SourceStagnant: column{
Name: "source_stagnant",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
SourceGutter: column{
Name: "source_gutter",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
TodEarly: column{
Name: "tod_early",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
TodDay: column{
Name: "tod_day",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
TodEvening: column{
Name: "tod_evening",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
TodNight: column{
Name: "tod_night",
DBType: "boolean",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
},
Indexes: publicreportNuisanceIndexes{
NuisancePkey1: index{
Type: "btree",
Name: "nuisance_pkey1",
Columns: []indexColumn{
{
Name: "report_id",
Desc: null.FromCond(false, true),
IsExpression: false,
},
},
Unique: true,
Comment: "",
NullsFirst: []bool{false},
NullsDistinct: false,
Where: "",
Include: []string{},
},
},
PrimaryKey: &constraint{
Name: "nuisance_pkey1",
Columns: []string{"report_id"},
Comment: "",
},
ForeignKeys: publicreportNuisanceForeignKeys{
PublicreportNuisanceNuisanceReportIDFkey: foreignKey{
constraint: constraint{
Name: "publicreport.nuisance.nuisance_report_id_fkey",
Columns: []string{"report_id"},
Comment: "",
},
ForeignTable: "publicreport.report",
ForeignColumns: []string{"id"},
},
},
Comment: "",
}
type publicreportNuisanceColumns struct {
AdditionalInfo column
Duration column
IsLocationBackyard column
IsLocationFrontyard column
IsLocationGarden column
IsLocationOther column
IsLocationPool column
ReportID column
SourceContainer column
SourceDescription column
SourceStagnant column
SourceGutter column
TodEarly column
TodDay column
TodEvening column
TodNight column
}
func (c publicreportNuisanceColumns) AsSlice() []column {
return []column{
c.AdditionalInfo, c.Duration, c.IsLocationBackyard, c.IsLocationFrontyard, c.IsLocationGarden, c.IsLocationOther, c.IsLocationPool, c.ReportID, c.SourceContainer, c.SourceDescription, c.SourceStagnant, c.SourceGutter, c.TodEarly, c.TodDay, c.TodEvening, c.TodNight,
}
}
type publicreportNuisanceIndexes struct {
NuisancePkey1 index
}
func (i publicreportNuisanceIndexes) AsSlice() []index {
return []index{
i.NuisancePkey1,
}
}
type publicreportNuisanceForeignKeys struct {
PublicreportNuisanceNuisanceReportIDFkey foreignKey
}
func (f publicreportNuisanceForeignKeys) AsSlice() []foreignKey {
return []foreignKey{
f.PublicreportNuisanceNuisanceReportIDFkey,
}
}
type publicreportNuisanceUniques struct{}
func (u publicreportNuisanceUniques) AsSlice() []constraint {
return []constraint{}
}
type publicreportNuisanceChecks struct{}
func (c publicreportNuisanceChecks) AsSlice() []check {
return []check{}
}