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,37 @@
// 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 TableNamePsModulePreference = "ps_module_preference"
// PsModulePreference mapped from table <ps_module_preference>
type PsModulePreference struct {
IDModulePreference int32 `gorm:"column:id_module_preference;primaryKey;autoIncrement:true" json:"id_module_preference"`
IDEmployee int32 `gorm:"column:id_employee;not null;uniqueIndex:employee_module,priority:1" json:"id_employee"`
Module string `gorm:"column:module;not null;uniqueIndex:employee_module,priority:2" json:"module"`
Interest *bool `gorm:"column:interest" json:"interest"`
Favorite *bool `gorm:"column:favorite" json:"favorite"`
}
// TableName PsModulePreference's table name
func (*PsModulePreference) TableName() string {
return TableNamePsModulePreference
}
var PsModulePreferenceCols = struct {
IDModulePreference gormcol.Field
IDEmployee gormcol.Field
Module gormcol.Field
Interest gormcol.Field
Favorite gormcol.Field
}{
IDModulePreference: gormcol.Field{Table: TableNamePsModulePreference, Column: "id_module_preference"},
IDEmployee: gormcol.Field{Table: TableNamePsModulePreference, Column: "id_employee"},
Module: gormcol.Field{Table: TableNamePsModulePreference, Column: "module"},
Interest: gormcol.Field{Table: TableNamePsModulePreference, Column: "interest"},
Favorite: gormcol.Field{Table: TableNamePsModulePreference, Column: "favorite"},
}