Use table name constant in Cols for type safety
This commit is contained in:
31
app/model/dbmodel/ps_page.go
Normal file
31
app/model/dbmodel/ps_page.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// 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 TableNamePsPage = "ps_page"
|
||||
|
||||
// PsPage mapped from table <ps_page>
|
||||
type PsPage struct {
|
||||
IDPage int32 `gorm:"column:id_page;primaryKey;autoIncrement:true" json:"id_page"`
|
||||
IDPageType int32 `gorm:"column:id_page_type;not null;index:id_page_type,priority:1" json:"id_page_type"`
|
||||
IDObject *int32 `gorm:"column:id_object;index:id_object,priority:1" json:"id_object"`
|
||||
}
|
||||
|
||||
// TableName PsPage's table name
|
||||
func (*PsPage) TableName() string {
|
||||
return TableNamePsPage
|
||||
}
|
||||
|
||||
var PsPageCols = struct {
|
||||
IDPage gormcol.Field
|
||||
IDPageType gormcol.Field
|
||||
IDObject gormcol.Field
|
||||
}{
|
||||
IDPage: gormcol.Field{Table: TableNamePsPage, Column: "id_page"},
|
||||
IDPageType: gormcol.Field{Table: TableNamePsPage, Column: "id_page_type"},
|
||||
IDObject: gormcol.Field{Table: TableNamePsPage, Column: "id_object"},
|
||||
}
|
||||
Reference in New Issue
Block a user