nidus-sync/db/dbinfo/comms.text_job.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

207 lines
4.5 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 CommsTextJobs = Table[
commsTextJobColumns,
commsTextJobIndexes,
commsTextJobForeignKeys,
commsTextJobUniques,
commsTextJobChecks,
]{
Schema: "comms",
Name: "text_job",
Columns: commsTextJobColumns{
Content: column{
Name: "content",
DBType: "text",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Created: column{
Name: "created",
DBType: "timestamp without time zone",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Destination: column{
Name: "destination",
DBType: "text",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
ID: column{
Name: "id",
DBType: "integer",
Default: "nextval('comms.text_job_id_seq'::regclass)",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Type: column{
Name: "type_",
DBType: "comms.textjobtype",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Source: column{
Name: "source",
DBType: "comms.textjobsource",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Completed: column{
Name: "completed",
DBType: "timestamp without time zone",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
CreatorID: column{
Name: "creator_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: commsTextJobIndexes{
TextJobPkey: index{
Type: "btree",
Name: "text_job_pkey",
Columns: []indexColumn{
{
Name: "id",
Desc: null.FromCond(false, true),
IsExpression: false,
},
},
Unique: true,
Comment: "",
NullsFirst: []bool{false},
NullsDistinct: false,
Where: "",
Include: []string{},
},
},
PrimaryKey: &constraint{
Name: "text_job_pkey",
Columns: []string{"id"},
Comment: "",
},
ForeignKeys: commsTextJobForeignKeys{
CommsTextJobTextJobCreatorIDFkey: foreignKey{
constraint: constraint{
Name: "comms.text_job.text_job_creator_id_fkey",
Columns: []string{"creator_id"},
Comment: "",
},
ForeignTable: "user_",
ForeignColumns: []string{"id"},
},
CommsTextJobTextJobDestinationFkey: foreignKey{
constraint: constraint{
Name: "comms.text_job.text_job_destination_fkey",
Columns: []string{"destination"},
Comment: "",
},
ForeignTable: "comms.phone",
ForeignColumns: []string{"e164"},
},
CommsTextJobTextJobReportIDFkey: foreignKey{
constraint: constraint{
Name: "comms.text_job.text_job_report_id_fkey",
Columns: []string{"report_id"},
Comment: "",
},
ForeignTable: "publicreport.report",
ForeignColumns: []string{"id"},
},
},
Comment: "Used to track text messages that should be sent later",
}
type commsTextJobColumns struct {
Content column
Created column
Destination column
ID column
Type column
Source column
Completed column
CreatorID column
ReportID column
}
func (c commsTextJobColumns) AsSlice() []column {
return []column{
c.Content, c.Created, c.Destination, c.ID, c.Type, c.Source, c.Completed, c.CreatorID, c.ReportID,
}
}
type commsTextJobIndexes struct {
TextJobPkey index
}
func (i commsTextJobIndexes) AsSlice() []index {
return []index{
i.TextJobPkey,
}
}
type commsTextJobForeignKeys struct {
CommsTextJobTextJobCreatorIDFkey foreignKey
CommsTextJobTextJobDestinationFkey foreignKey
CommsTextJobTextJobReportIDFkey foreignKey
}
func (f commsTextJobForeignKeys) AsSlice() []foreignKey {
return []foreignKey{
f.CommsTextJobTextJobCreatorIDFkey, f.CommsTextJobTextJobDestinationFkey, f.CommsTextJobTextJobReportIDFkey,
}
}
type commsTextJobUniques struct{}
func (u commsTextJobUniques) AsSlice() []constraint {
return []constraint{}
}
type commsTextJobChecks struct{}
func (c commsTextJobChecks) AsSlice() []check {
return []check{}
}