Use table name constant in Cols for type safety
This commit is contained in:
34
app/model/dbmodel/ps_attribute.go
Normal file
34
app/model/dbmodel/ps_attribute.go
Normal 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"},
|
||||
}
|
||||
Reference in New Issue
Block a user