Use table name constant in Cols for type safety
This commit is contained in:
34
app/model/dbmodel/ps_alias.go
Normal file
34
app/model/dbmodel/ps_alias.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 TableNamePsAlias = "ps_alias"
|
||||
|
||||
// PsAlias mapped from table <ps_alias>
|
||||
type PsAlias struct {
|
||||
IDAlias int32 `gorm:"column:id_alias;primaryKey;autoIncrement:true" json:"id_alias"`
|
||||
Alias string `gorm:"column:alias;not null;uniqueIndex:alias,priority:1" json:"alias"`
|
||||
Search string `gorm:"column:search;not null" json:"search"`
|
||||
Active bool `gorm:"column:active;not null;default:1" json:"active"`
|
||||
}
|
||||
|
||||
// TableName PsAlias's table name
|
||||
func (*PsAlias) TableName() string {
|
||||
return TableNamePsAlias
|
||||
}
|
||||
|
||||
var PsAliasCols = struct {
|
||||
IDAlias gormcol.Field
|
||||
Alias gormcol.Field
|
||||
Search gormcol.Field
|
||||
Active gormcol.Field
|
||||
}{
|
||||
IDAlias: gormcol.Field{Table: TableNamePsAlias, Column: "id_alias"},
|
||||
Alias: gormcol.Field{Table: TableNamePsAlias, Column: "alias"},
|
||||
Search: gormcol.Field{Table: TableNamePsAlias, Column: "search"},
|
||||
Active: gormcol.Field{Table: TableNamePsAlias, Column: "active"},
|
||||
}
|
||||
Reference in New Issue
Block a user