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,49 @@
// 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 TableNamePsMessage = "ps_message"
// PsMessage mapped from table <ps_message>
type PsMessage struct {
IDMessage int32 `gorm:"column:id_message;primaryKey;autoIncrement:true" json:"id_message"`
IDCart *int32 `gorm:"column:id_cart;index:id_cart,priority:1" json:"id_cart"`
IDCustomer int32 `gorm:"column:id_customer;not null;index:id_customer,priority:1" json:"id_customer"`
IDEmployee *int32 `gorm:"column:id_employee;index:id_employee,priority:1" json:"id_employee"`
IDOrder int32 `gorm:"column:id_order;not null;index:message_order,priority:1" json:"id_order"`
Message string `gorm:"column:message;not null" json:"message"`
Private bool `gorm:"column:private;not null;default:1" json:"private"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
}
// TableName PsMessage's table name
func (*PsMessage) TableName() string {
return TableNamePsMessage
}
var PsMessageCols = struct {
IDMessage gormcol.Field
IDCart gormcol.Field
IDCustomer gormcol.Field
IDEmployee gormcol.Field
IDOrder gormcol.Field
Message gormcol.Field
Private gormcol.Field
DateAdd gormcol.Field
}{
IDMessage: gormcol.Field{Table: TableNamePsMessage, Column: "id_message"},
IDCart: gormcol.Field{Table: TableNamePsMessage, Column: "id_cart"},
IDCustomer: gormcol.Field{Table: TableNamePsMessage, Column: "id_customer"},
IDEmployee: gormcol.Field{Table: TableNamePsMessage, Column: "id_employee"},
IDOrder: gormcol.Field{Table: TableNamePsMessage, Column: "id_order"},
Message: gormcol.Field{Table: TableNamePsMessage, Column: "message"},
Private: gormcol.Field{Table: TableNamePsMessage, Column: "private"},
DateAdd: gormcol.Field{Table: TableNamePsMessage, Column: "date_add"},
}