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.
This commit is contained in:
parent
2538638c9d
commit
1e071d5ce5
109 changed files with 22903 additions and 11713 deletions
152
db/dbinfo/publicreport.notify_phone_nuisance_old.bob.go
Normal file
152
db/dbinfo/publicreport.notify_phone_nuisance_old.bob.go
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
// 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 PublicreportNotifyPhoneNuisanceOlds = Table[
|
||||
publicreportNotifyPhoneNuisanceOldColumns,
|
||||
publicreportNotifyPhoneNuisanceOldIndexes,
|
||||
publicreportNotifyPhoneNuisanceOldForeignKeys,
|
||||
publicreportNotifyPhoneNuisanceOldUniques,
|
||||
publicreportNotifyPhoneNuisanceOldChecks,
|
||||
]{
|
||||
Schema: "publicreport",
|
||||
Name: "notify_phone_nuisance_old",
|
||||
Columns: publicreportNotifyPhoneNuisanceOldColumns{
|
||||
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,
|
||||
},
|
||||
NuisanceID: column{
|
||||
Name: "nuisance_id",
|
||||
DBType: "integer",
|
||||
Default: "",
|
||||
Comment: "",
|
||||
Nullable: false,
|
||||
Generated: false,
|
||||
AutoIncr: false,
|
||||
},
|
||||
PhoneE164: column{
|
||||
Name: "phone_e164",
|
||||
DBType: "text",
|
||||
Default: "",
|
||||
Comment: "",
|
||||
Nullable: false,
|
||||
Generated: false,
|
||||
AutoIncr: false,
|
||||
},
|
||||
},
|
||||
Indexes: publicreportNotifyPhoneNuisanceOldIndexes{
|
||||
NotifyPhoneNuisancePkey: index{
|
||||
Type: "btree",
|
||||
Name: "notify_phone_nuisance_pkey",
|
||||
Columns: []indexColumn{
|
||||
{
|
||||
Name: "nuisance_id",
|
||||
Desc: null.FromCond(false, true),
|
||||
IsExpression: false,
|
||||
},
|
||||
{
|
||||
Name: "phone_e164",
|
||||
Desc: null.FromCond(false, true),
|
||||
IsExpression: false,
|
||||
},
|
||||
},
|
||||
Unique: true,
|
||||
Comment: "",
|
||||
NullsFirst: []bool{false, false},
|
||||
NullsDistinct: false,
|
||||
Where: "",
|
||||
Include: []string{},
|
||||
},
|
||||
},
|
||||
PrimaryKey: &constraint{
|
||||
Name: "notify_phone_nuisance_pkey",
|
||||
Columns: []string{"nuisance_id", "phone_e164"},
|
||||
Comment: "",
|
||||
},
|
||||
ForeignKeys: publicreportNotifyPhoneNuisanceOldForeignKeys{
|
||||
PublicreportNotifyPhoneNuisanceOldNotifyPhoneNuisanceNuisanceIDFkey: foreignKey{
|
||||
constraint: constraint{
|
||||
Name: "publicreport.notify_phone_nuisance_old.notify_phone_nuisance_nuisance_id_fkey",
|
||||
Columns: []string{"nuisance_id"},
|
||||
Comment: "",
|
||||
},
|
||||
ForeignTable: "publicreport.nuisance_old",
|
||||
ForeignColumns: []string{"id"},
|
||||
},
|
||||
PublicreportNotifyPhoneNuisanceOldNotifyPhoneNuisancePhoneE164Fkey: foreignKey{
|
||||
constraint: constraint{
|
||||
Name: "publicreport.notify_phone_nuisance_old.notify_phone_nuisance_phone_e164_fkey",
|
||||
Columns: []string{"phone_e164"},
|
||||
Comment: "",
|
||||
},
|
||||
ForeignTable: "comms.phone",
|
||||
ForeignColumns: []string{"e164"},
|
||||
},
|
||||
},
|
||||
|
||||
Comment: "",
|
||||
}
|
||||
|
||||
type publicreportNotifyPhoneNuisanceOldColumns struct {
|
||||
Created column
|
||||
Deleted column
|
||||
NuisanceID column
|
||||
PhoneE164 column
|
||||
}
|
||||
|
||||
func (c publicreportNotifyPhoneNuisanceOldColumns) AsSlice() []column {
|
||||
return []column{
|
||||
c.Created, c.Deleted, c.NuisanceID, c.PhoneE164,
|
||||
}
|
||||
}
|
||||
|
||||
type publicreportNotifyPhoneNuisanceOldIndexes struct {
|
||||
NotifyPhoneNuisancePkey index
|
||||
}
|
||||
|
||||
func (i publicreportNotifyPhoneNuisanceOldIndexes) AsSlice() []index {
|
||||
return []index{
|
||||
i.NotifyPhoneNuisancePkey,
|
||||
}
|
||||
}
|
||||
|
||||
type publicreportNotifyPhoneNuisanceOldForeignKeys struct {
|
||||
PublicreportNotifyPhoneNuisanceOldNotifyPhoneNuisanceNuisanceIDFkey foreignKey
|
||||
PublicreportNotifyPhoneNuisanceOldNotifyPhoneNuisancePhoneE164Fkey foreignKey
|
||||
}
|
||||
|
||||
func (f publicreportNotifyPhoneNuisanceOldForeignKeys) AsSlice() []foreignKey {
|
||||
return []foreignKey{
|
||||
f.PublicreportNotifyPhoneNuisanceOldNotifyPhoneNuisanceNuisanceIDFkey, f.PublicreportNotifyPhoneNuisanceOldNotifyPhoneNuisancePhoneE164Fkey,
|
||||
}
|
||||
}
|
||||
|
||||
type publicreportNotifyPhoneNuisanceOldUniques struct{}
|
||||
|
||||
func (u publicreportNotifyPhoneNuisanceOldUniques) AsSlice() []constraint {
|
||||
return []constraint{}
|
||||
}
|
||||
|
||||
type publicreportNotifyPhoneNuisanceOldChecks struct{}
|
||||
|
||||
func (c publicreportNotifyPhoneNuisanceOldChecks) AsSlice() []check {
|
||||
return []check{}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue