Use table name constant in Cols for type safety

This commit is contained in:
2026-03-29 15:29:39 +02:00
parent 0cfddddccb
commit a53e24c5b8
315 changed files with 13092 additions and 5 deletions

View File

@@ -0,0 +1,43 @@
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package dbmodel
import (
"git.ma-al.com/goc_marek/gormcol"
"time"
)
const TableNamePsMail = "ps_mail"
// PsMail mapped from table <ps_mail>
type PsMail struct {
IDMail int32 `gorm:"column:id_mail;primaryKey;autoIncrement:true" json:"id_mail"`
Recipient string `gorm:"column:recipient;not null;index:recipient,priority:1" json:"recipient"`
Template string `gorm:"column:template;not null" json:"template"`
Subject string `gorm:"column:subject;not null" json:"subject"`
IDLang int32 `gorm:"column:id_lang;not null" json:"id_lang"`
DateAdd time.Time `gorm:"column:date_add;not null;default:current_timestamp()" json:"date_add"`
}
// TableName PsMail's table name
func (*PsMail) TableName() string {
return TableNamePsMail
}
var PsMailCols = struct {
IDMail gormcol.Field
Recipient gormcol.Field
Template gormcol.Field
Subject gormcol.Field
IDLang gormcol.Field
DateAdd gormcol.Field
}{
IDMail: gormcol.Field{Table: TableNamePsMail, Column: "id_mail"},
Recipient: gormcol.Field{Table: TableNamePsMail, Column: "recipient"},
Template: gormcol.Field{Table: TableNamePsMail, Column: "template"},
Subject: gormcol.Field{Table: TableNamePsMail, Column: "subject"},
IDLang: gormcol.Field{Table: TableNamePsMail, Column: "id_lang"},
DateAdd: gormcol.Field{Table: TableNamePsMail, Column: "date_add"},
}