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.
132 lines
3.3 KiB
Go
132 lines
3.3 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 PublicreportNuisanceImageOlds = Table[
|
|
publicreportNuisanceImageOldColumns,
|
|
publicreportNuisanceImageOldIndexes,
|
|
publicreportNuisanceImageOldForeignKeys,
|
|
publicreportNuisanceImageOldUniques,
|
|
publicreportNuisanceImageOldChecks,
|
|
]{
|
|
Schema: "publicreport",
|
|
Name: "nuisance_image_old",
|
|
Columns: publicreportNuisanceImageOldColumns{
|
|
ImageID: column{
|
|
Name: "image_id",
|
|
DBType: "integer",
|
|
Default: "",
|
|
Comment: "",
|
|
Nullable: false,
|
|
Generated: false,
|
|
AutoIncr: false,
|
|
},
|
|
NuisanceID: column{
|
|
Name: "nuisance_id",
|
|
DBType: "integer",
|
|
Default: "",
|
|
Comment: "",
|
|
Nullable: false,
|
|
Generated: false,
|
|
AutoIncr: false,
|
|
},
|
|
},
|
|
Indexes: publicreportNuisanceImageOldIndexes{
|
|
NuisanceImagePkey: index{
|
|
Type: "btree",
|
|
Name: "nuisance_image_pkey",
|
|
Columns: []indexColumn{
|
|
{
|
|
Name: "image_id",
|
|
Desc: null.FromCond(false, true),
|
|
IsExpression: false,
|
|
},
|
|
{
|
|
Name: "nuisance_id",
|
|
Desc: null.FromCond(false, true),
|
|
IsExpression: false,
|
|
},
|
|
},
|
|
Unique: true,
|
|
Comment: "",
|
|
NullsFirst: []bool{false, false},
|
|
NullsDistinct: false,
|
|
Where: "",
|
|
Include: []string{},
|
|
},
|
|
},
|
|
PrimaryKey: &constraint{
|
|
Name: "nuisance_image_pkey",
|
|
Columns: []string{"image_id", "nuisance_id"},
|
|
Comment: "",
|
|
},
|
|
ForeignKeys: publicreportNuisanceImageOldForeignKeys{
|
|
PublicreportNuisanceImageOldNuisanceImageImageIDFkey: foreignKey{
|
|
constraint: constraint{
|
|
Name: "publicreport.nuisance_image_old.nuisance_image_image_id_fkey",
|
|
Columns: []string{"image_id"},
|
|
Comment: "",
|
|
},
|
|
ForeignTable: "publicreport.image",
|
|
ForeignColumns: []string{"id"},
|
|
},
|
|
PublicreportNuisanceImageOldNuisanceImageNuisanceIDFkey: foreignKey{
|
|
constraint: constraint{
|
|
Name: "publicreport.nuisance_image_old.nuisance_image_nuisance_id_fkey",
|
|
Columns: []string{"nuisance_id"},
|
|
Comment: "",
|
|
},
|
|
ForeignTable: "publicreport.nuisance_old",
|
|
ForeignColumns: []string{"id"},
|
|
},
|
|
},
|
|
|
|
Comment: "",
|
|
}
|
|
|
|
type publicreportNuisanceImageOldColumns struct {
|
|
ImageID column
|
|
NuisanceID column
|
|
}
|
|
|
|
func (c publicreportNuisanceImageOldColumns) AsSlice() []column {
|
|
return []column{
|
|
c.ImageID, c.NuisanceID,
|
|
}
|
|
}
|
|
|
|
type publicreportNuisanceImageOldIndexes struct {
|
|
NuisanceImagePkey index
|
|
}
|
|
|
|
func (i publicreportNuisanceImageOldIndexes) AsSlice() []index {
|
|
return []index{
|
|
i.NuisanceImagePkey,
|
|
}
|
|
}
|
|
|
|
type publicreportNuisanceImageOldForeignKeys struct {
|
|
PublicreportNuisanceImageOldNuisanceImageImageIDFkey foreignKey
|
|
PublicreportNuisanceImageOldNuisanceImageNuisanceIDFkey foreignKey
|
|
}
|
|
|
|
func (f publicreportNuisanceImageOldForeignKeys) AsSlice() []foreignKey {
|
|
return []foreignKey{
|
|
f.PublicreportNuisanceImageOldNuisanceImageImageIDFkey, f.PublicreportNuisanceImageOldNuisanceImageNuisanceIDFkey,
|
|
}
|
|
}
|
|
|
|
type publicreportNuisanceImageOldUniques struct{}
|
|
|
|
func (u publicreportNuisanceImageOldUniques) AsSlice() []constraint {
|
|
return []constraint{}
|
|
}
|
|
|
|
type publicreportNuisanceImageOldChecks struct{}
|
|
|
|
func (c publicreportNuisanceImageOldChecks) AsSlice() []check {
|
|
return []check{}
|
|
}
|