Add DB model for publicreport logs
It's just way easier to track that deriving the data every time an API request is made.
This commit is contained in:
parent
1e071d5ce5
commit
1d2570c912
14 changed files with 2326 additions and 140 deletions
197
db/dbinfo/publicreport.report_log.bob.go
Normal file
197
db/dbinfo/publicreport.report_log.bob.go
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
// 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 PublicreportReportLogs = Table[
|
||||
publicreportReportLogColumns,
|
||||
publicreportReportLogIndexes,
|
||||
publicreportReportLogForeignKeys,
|
||||
publicreportReportLogUniques,
|
||||
publicreportReportLogChecks,
|
||||
]{
|
||||
Schema: "publicreport",
|
||||
Name: "report_log",
|
||||
Columns: publicreportReportLogColumns{
|
||||
Created: column{
|
||||
Name: "created",
|
||||
DBType: "timestamp without time zone",
|
||||
Default: "",
|
||||
Comment: "",
|
||||
Nullable: false,
|
||||
Generated: false,
|
||||
AutoIncr: false,
|
||||
},
|
||||
EmailLogID: column{
|
||||
Name: "email_log_id",
|
||||
DBType: "integer",
|
||||
Default: "NULL",
|
||||
Comment: "",
|
||||
Nullable: true,
|
||||
Generated: false,
|
||||
AutoIncr: false,
|
||||
},
|
||||
ID: column{
|
||||
Name: "id",
|
||||
DBType: "integer",
|
||||
Default: "nextval('publicreport.report_log_id_seq'::regclass)",
|
||||
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: "NULL",
|
||||
Comment: "",
|
||||
Nullable: true,
|
||||
Generated: false,
|
||||
AutoIncr: false,
|
||||
},
|
||||
Type: column{
|
||||
Name: "type_",
|
||||
DBType: "publicreport.reportlogtype",
|
||||
Default: "",
|
||||
Comment: "",
|
||||
Nullable: false,
|
||||
Generated: false,
|
||||
AutoIncr: false,
|
||||
},
|
||||
UserID: column{
|
||||
Name: "user_id",
|
||||
DBType: "integer",
|
||||
Default: "NULL",
|
||||
Comment: "",
|
||||
Nullable: true,
|
||||
Generated: false,
|
||||
AutoIncr: false,
|
||||
},
|
||||
},
|
||||
Indexes: publicreportReportLogIndexes{
|
||||
ReportLogPkey: index{
|
||||
Type: "btree",
|
||||
Name: "report_log_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: "report_log_pkey",
|
||||
Columns: []string{"id"},
|
||||
Comment: "",
|
||||
},
|
||||
ForeignKeys: publicreportReportLogForeignKeys{
|
||||
PublicreportReportLogReportLogEmailLogIDFkey: foreignKey{
|
||||
constraint: constraint{
|
||||
Name: "publicreport.report_log.report_log_email_log_id_fkey",
|
||||
Columns: []string{"email_log_id"},
|
||||
Comment: "",
|
||||
},
|
||||
ForeignTable: "comms.email_log",
|
||||
ForeignColumns: []string{"id"},
|
||||
},
|
||||
PublicreportReportLogReportLogReportIDFkey: foreignKey{
|
||||
constraint: constraint{
|
||||
Name: "publicreport.report_log.report_log_report_id_fkey",
|
||||
Columns: []string{"report_id"},
|
||||
Comment: "",
|
||||
},
|
||||
ForeignTable: "publicreport.report",
|
||||
ForeignColumns: []string{"id"},
|
||||
},
|
||||
PublicreportReportLogReportLogTextLogIDFkey: foreignKey{
|
||||
constraint: constraint{
|
||||
Name: "publicreport.report_log.report_log_text_log_id_fkey",
|
||||
Columns: []string{"text_log_id"},
|
||||
Comment: "",
|
||||
},
|
||||
ForeignTable: "comms.text_log",
|
||||
ForeignColumns: []string{"id"},
|
||||
},
|
||||
PublicreportReportLogReportLogUserIDFkey: foreignKey{
|
||||
constraint: constraint{
|
||||
Name: "publicreport.report_log.report_log_user_id_fkey",
|
||||
Columns: []string{"user_id"},
|
||||
Comment: "",
|
||||
},
|
||||
ForeignTable: "user_",
|
||||
ForeignColumns: []string{"id"},
|
||||
},
|
||||
},
|
||||
|
||||
Comment: "",
|
||||
}
|
||||
|
||||
type publicreportReportLogColumns struct {
|
||||
Created column
|
||||
EmailLogID column
|
||||
ID column
|
||||
ReportID column
|
||||
TextLogID column
|
||||
Type column
|
||||
UserID column
|
||||
}
|
||||
|
||||
func (c publicreportReportLogColumns) AsSlice() []column {
|
||||
return []column{
|
||||
c.Created, c.EmailLogID, c.ID, c.ReportID, c.TextLogID, c.Type, c.UserID,
|
||||
}
|
||||
}
|
||||
|
||||
type publicreportReportLogIndexes struct {
|
||||
ReportLogPkey index
|
||||
}
|
||||
|
||||
func (i publicreportReportLogIndexes) AsSlice() []index {
|
||||
return []index{
|
||||
i.ReportLogPkey,
|
||||
}
|
||||
}
|
||||
|
||||
type publicreportReportLogForeignKeys struct {
|
||||
PublicreportReportLogReportLogEmailLogIDFkey foreignKey
|
||||
PublicreportReportLogReportLogReportIDFkey foreignKey
|
||||
PublicreportReportLogReportLogTextLogIDFkey foreignKey
|
||||
PublicreportReportLogReportLogUserIDFkey foreignKey
|
||||
}
|
||||
|
||||
func (f publicreportReportLogForeignKeys) AsSlice() []foreignKey {
|
||||
return []foreignKey{
|
||||
f.PublicreportReportLogReportLogEmailLogIDFkey, f.PublicreportReportLogReportLogReportIDFkey, f.PublicreportReportLogReportLogTextLogIDFkey, f.PublicreportReportLogReportLogUserIDFkey,
|
||||
}
|
||||
}
|
||||
|
||||
type publicreportReportLogUniques struct{}
|
||||
|
||||
func (u publicreportReportLogUniques) AsSlice() []constraint {
|
||||
return []constraint{}
|
||||
}
|
||||
|
||||
type publicreportReportLogChecks struct{}
|
||||
|
||||
func (c publicreportReportLogChecks) AsSlice() []check {
|
||||
return []check{}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue