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

157 lines
3.4 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 ReportTexts = Table[
reportTextColumns,
reportTextIndexes,
reportTextForeignKeys,
reportTextUniques,
reportTextChecks,
]{
Schema: "",
Name: "report_text",
Columns: reportTextColumns{
CreatorID: column{
Name: "creator_id",
DBType: "integer",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
ReportID: column{
Name: "report_id",
DBType: "integer",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
TextLogID: column{
Name: "text_log_id",
DBType: "integer",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
},
Indexes: reportTextIndexes{
ReportTextPkey: index{
Type: "btree",
Name: "report_text_pkey",
Columns: []indexColumn{
{
Name: "creator_id",
Desc: null.FromCond(false, true),
IsExpression: false,
},
{
Name: "report_id",
Desc: null.FromCond(false, true),
IsExpression: false,
},
{
Name: "text_log_id",
Desc: null.FromCond(false, true),
IsExpression: false,
},
},
Unique: true,
Comment: "",
NullsFirst: []bool{false, false, false},
NullsDistinct: false,
Where: "",
Include: []string{},
},
},
PrimaryKey: &constraint{
Name: "report_text_pkey",
Columns: []string{"creator_id", "report_id", "text_log_id"},
Comment: "",
},
ForeignKeys: reportTextForeignKeys{
ReportTextReportTextCreatorIDFkey: foreignKey{
constraint: constraint{
Name: "report_text.report_text_creator_id_fkey",
Columns: []string{"creator_id"},
Comment: "",
},
ForeignTable: "user_",
ForeignColumns: []string{"id"},
},
ReportTextReportTextReportIDFkey: foreignKey{
constraint: constraint{
Name: "report_text.report_text_report_id_fkey",
Columns: []string{"report_id"},
Comment: "",
},
ForeignTable: "publicreport.report",
ForeignColumns: []string{"id"},
},
ReportTextReportTextTextLogIDFkey: foreignKey{
constraint: constraint{
Name: "report_text.report_text_text_log_id_fkey",
Columns: []string{"text_log_id"},
Comment: "",
},
ForeignTable: "comms.text_log",
ForeignColumns: []string{"id"},
},
},
Comment: "",
}
type reportTextColumns struct {
CreatorID column
ReportID column
TextLogID column
}
func (c reportTextColumns) AsSlice() []column {
return []column{
c.CreatorID, c.ReportID, c.TextLogID,
}
}
type reportTextIndexes struct {
ReportTextPkey index
}
func (i reportTextIndexes) AsSlice() []index {
return []index{
i.ReportTextPkey,
}
}
type reportTextForeignKeys struct {
ReportTextReportTextCreatorIDFkey foreignKey
ReportTextReportTextReportIDFkey foreignKey
ReportTextReportTextTextLogIDFkey foreignKey
}
func (f reportTextForeignKeys) AsSlice() []foreignKey {
return []foreignKey{
f.ReportTextReportTextCreatorIDFkey, f.ReportTextReportTextReportIDFkey, f.ReportTextReportTextTextLogIDFkey,
}
}
type reportTextUniques struct{}
func (u reportTextUniques) AsSlice() []constraint {
return []constraint{}
}
type reportTextChecks struct{}
func (c reportTextChecks) AsSlice() []check {
return []check{}
}