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"
const TableNamePsWarehouse = "ps_warehouse"
// PsWarehouse mapped from table <ps_warehouse>
type PsWarehouse struct {
IDWarehouse int32 `gorm:"column:id_warehouse;primaryKey;autoIncrement:true" json:"id_warehouse"`
IDCurrency int32 `gorm:"column:id_currency;not null" json:"id_currency"`
IDAddress int32 `gorm:"column:id_address;not null" json:"id_address"`
IDEmployee int32 `gorm:"column:id_employee;not null" json:"id_employee"`
Reference *string `gorm:"column:reference" json:"reference"`
Name string `gorm:"column:name;not null" json:"name"`
ManagementType string `gorm:"column:management_type;not null;default:WA" json:"management_type"`
Deleted bool `gorm:"column:deleted;not null" json:"deleted"`
}
// TableName PsWarehouse's table name
func (*PsWarehouse) TableName() string {
return TableNamePsWarehouse
}
var PsWarehouseCols = struct {
IDWarehouse gormcol.Field
IDCurrency gormcol.Field
IDAddress gormcol.Field
IDEmployee gormcol.Field
Reference gormcol.Field
Name gormcol.Field
ManagementType gormcol.Field
Deleted gormcol.Field
}{
IDWarehouse: gormcol.Field{Table: TableNamePsWarehouse, Column: "id_warehouse"},
IDCurrency: gormcol.Field{Table: TableNamePsWarehouse, Column: "id_currency"},
IDAddress: gormcol.Field{Table: TableNamePsWarehouse, Column: "id_address"},
IDEmployee: gormcol.Field{Table: TableNamePsWarehouse, Column: "id_employee"},
Reference: gormcol.Field{Table: TableNamePsWarehouse, Column: "reference"},
Name: gormcol.Field{Table: TableNamePsWarehouse, Column: "name"},
ManagementType: gormcol.Field{Table: TableNamePsWarehouse, Column: "management_type"},
Deleted: gormcol.Field{Table: TableNamePsWarehouse, Column: "deleted"},
}