Use table name constant in Cols for type safety
This commit is contained in:
40
app/model/dbmodel/ps_invoice_customer.go
Normal file
40
app/model/dbmodel/ps_invoice_customer.go
Normal file
@@ -0,0 +1,40 @@
|
||||
// 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"
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNamePsInvoiceCustomer = "ps_invoice_customer"
|
||||
|
||||
// PsInvoiceCustomer mapped from table <ps_invoice_customer>
|
||||
type PsInvoiceCustomer struct {
|
||||
IDInvoiceCustomer int32 `gorm:"column:id_invoice_customer;primaryKey;autoIncrement:true" json:"id_invoice_customer"`
|
||||
IDCustomer int32 `gorm:"column:id_customer;not null;uniqueIndex:UQ_ps_invoice_customer_id_customer,priority:1" json:"id_customer"`
|
||||
IDShopCompany int32 `gorm:"column:id_shop_company;not null;index:FK_ps_invoice_customer_id_shop_company,priority:1" json:"id_shop_company"`
|
||||
DateAdd *time.Time `gorm:"column:date_add;default:current_timestamp()" json:"date_add"`
|
||||
DateUpd *time.Time `gorm:"column:date_upd;default:current_timestamp()" json:"date_upd"`
|
||||
}
|
||||
|
||||
// TableName PsInvoiceCustomer's table name
|
||||
func (*PsInvoiceCustomer) TableName() string {
|
||||
return TableNamePsInvoiceCustomer
|
||||
}
|
||||
|
||||
var PsInvoiceCustomerCols = struct {
|
||||
IDInvoiceCustomer gormcol.Field
|
||||
IDCustomer gormcol.Field
|
||||
IDShopCompany gormcol.Field
|
||||
DateAdd gormcol.Field
|
||||
DateUpd gormcol.Field
|
||||
}{
|
||||
IDInvoiceCustomer: gormcol.Field{Table: TableNamePsInvoiceCustomer, Column: "id_invoice_customer"},
|
||||
IDCustomer: gormcol.Field{Table: TableNamePsInvoiceCustomer, Column: "id_customer"},
|
||||
IDShopCompany: gormcol.Field{Table: TableNamePsInvoiceCustomer, Column: "id_shop_company"},
|
||||
DateAdd: gormcol.Field{Table: TableNamePsInvoiceCustomer, Column: "date_add"},
|
||||
DateUpd: gormcol.Field{Table: TableNamePsInvoiceCustomer, Column: "date_upd"},
|
||||
}
|
||||
Reference in New Issue
Block a user