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:
Eli Ribble 2026-03-18 15:36:20 +00:00
parent 2538638c9d
commit 1e071d5ce5
No known key found for this signature in database
109 changed files with 22903 additions and 11713 deletions

View file

@ -691,11 +691,13 @@ func (e *CommsTextjobsource) Scan(value any) error {
// Enum values for CommsTextjobtype
const (
CommsTextjobtypeReportConfirmation CommsTextjobtype = "report-confirmation"
CommsTextjobtypeReportMessage CommsTextjobtype = "report-message"
)
func AllCommsTextjobtype() []CommsTextjobtype {
return []CommsTextjobtype{
CommsTextjobtypeReportConfirmation,
CommsTextjobtypeReportMessage,
}
}
@ -707,7 +709,8 @@ func (e CommsTextjobtype) String() string {
func (e CommsTextjobtype) Valid() bool {
switch e {
case CommsTextjobtypeReportConfirmation:
case CommsTextjobtypeReportConfirmation,
CommsTextjobtypeReportMessage:
return true
default:
return false
@ -1299,6 +1302,7 @@ const (
JobtypeCSVImport Jobtype = "csv-import"
JobtypeLabelStudioAudioCreate Jobtype = "label-studio-audio-create"
JobtypeEmailSend Jobtype = "email-send"
JobtypeTextRespond Jobtype = "text-respond"
JobtypeTextSend Jobtype = "text-send"
)
@ -1309,6 +1313,7 @@ func AllJobtype() []Jobtype {
JobtypeCSVImport,
JobtypeLabelStudioAudioCreate,
JobtypeEmailSend,
JobtypeTextRespond,
JobtypeTextSend,
}
}
@ -1326,6 +1331,7 @@ func (e Jobtype) Valid() bool {
JobtypeCSVImport,
JobtypeLabelStudioAudioCreate,
JobtypeEmailSend,
JobtypeTextRespond,
JobtypeTextSend:
return true
default: