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,34 @@
// 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 TableNamePsAttribute = "ps_attribute"
// PsAttribute mapped from table <ps_attribute>
type PsAttribute struct {
IDAttribute int32 `gorm:"column:id_attribute;primaryKey;autoIncrement:true" json:"id_attribute"`
IDAttributeGroup int32 `gorm:"column:id_attribute_group;not null;index:attribute_group,priority:1" json:"id_attribute_group"`
Color string `gorm:"column:color;not null" json:"color"`
Position int32 `gorm:"column:position;not null" json:"position"`
}
// TableName PsAttribute's table name
func (*PsAttribute) TableName() string {
return TableNamePsAttribute
}
var PsAttributeCols = struct {
IDAttribute gormcol.Field
IDAttributeGroup gormcol.Field
Color gormcol.Field
Position gormcol.Field
}{
IDAttribute: gormcol.Field{Table: TableNamePsAttribute, Column: "id_attribute"},
IDAttributeGroup: gormcol.Field{Table: TableNamePsAttribute, Column: "id_attribute_group"},
Color: gormcol.Field{Table: TableNamePsAttribute, Column: "color"},
Position: gormcol.Field{Table: TableNamePsAttribute, Column: "position"},
}