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,46 @@
// 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 TableNamePsConfiguration = "ps_configuration"
// PsConfiguration mapped from table <ps_configuration>
type PsConfiguration struct {
IDConfiguration int32 `gorm:"column:id_configuration;primaryKey;autoIncrement:true" json:"id_configuration"`
IDShopGroup *int32 `gorm:"column:id_shop_group;index:id_shop_group,priority:1" json:"id_shop_group"`
IDShop *int32 `gorm:"column:id_shop;index:id_shop,priority:1" json:"id_shop"`
Name string `gorm:"column:name;not null;index:name,priority:1" json:"name"`
Value *string `gorm:"column:value" json:"value"`
DateAdd time.Time `gorm:"column:date_add;not null" json:"date_add"`
DateUpd time.Time `gorm:"column:date_upd;not null" json:"date_upd"`
}
// TableName PsConfiguration's table name
func (*PsConfiguration) TableName() string {
return TableNamePsConfiguration
}
var PsConfigurationCols = struct {
IDConfiguration gormcol.Field
IDShopGroup gormcol.Field
IDShop gormcol.Field
Name gormcol.Field
Value gormcol.Field
DateAdd gormcol.Field
DateUpd gormcol.Field
}{
IDConfiguration: gormcol.Field{Table: TableNamePsConfiguration, Column: "id_configuration"},
IDShopGroup: gormcol.Field{Table: TableNamePsConfiguration, Column: "id_shop_group"},
IDShop: gormcol.Field{Table: TableNamePsConfiguration, Column: "id_shop"},
Name: gormcol.Field{Table: TableNamePsConfiguration, Column: "name"},
Value: gormcol.Field{Table: TableNamePsConfiguration, Column: "value"},
DateAdd: gormcol.Field{Table: TableNamePsConfiguration, Column: "date_add"},
DateUpd: gormcol.Field{Table: TableNamePsConfiguration, Column: "date_upd"},
}