Use table name constant in Cols for type safety
This commit is contained in:
34
app/model/dbmodel/ps_contact.go
Normal file
34
app/model/dbmodel/ps_contact.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 TableNamePsContact = "ps_contact"
|
||||
|
||||
// PsContact mapped from table <ps_contact>
|
||||
type PsContact struct {
|
||||
IDContact int32 `gorm:"column:id_contact;primaryKey;autoIncrement:true" json:"id_contact"`
|
||||
Email string `gorm:"column:email;not null" json:"email"`
|
||||
CustomerService bool `gorm:"column:customer_service;not null" json:"customer_service"`
|
||||
Position int32 `gorm:"column:position;not null" json:"position"`
|
||||
}
|
||||
|
||||
// TableName PsContact's table name
|
||||
func (*PsContact) TableName() string {
|
||||
return TableNamePsContact
|
||||
}
|
||||
|
||||
var PsContactCols = struct {
|
||||
IDContact gormcol.Field
|
||||
Email gormcol.Field
|
||||
CustomerService gormcol.Field
|
||||
Position gormcol.Field
|
||||
}{
|
||||
IDContact: gormcol.Field{Table: TableNamePsContact, Column: "id_contact"},
|
||||
Email: gormcol.Field{Table: TableNamePsContact, Column: "email"},
|
||||
CustomerService: gormcol.Field{Table: TableNamePsContact, Column: "customer_service"},
|
||||
Position: gormcol.Field{Table: TableNamePsContact, Column: "position"},
|
||||
}
|
||||
Reference in New Issue
Block a user