Use table name constant in Cols for type safety
This commit is contained in:
55
app/model/dbmodel/ps_country.go
Normal file
55
app/model/dbmodel/ps_country.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// 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 TableNamePsCountry = "ps_country"
|
||||
|
||||
// PsCountry mapped from table <ps_country>
|
||||
type PsCountry struct {
|
||||
IDCountry int32 `gorm:"column:id_country;primaryKey;autoIncrement:true" json:"id_country"`
|
||||
IDZone int32 `gorm:"column:id_zone;not null;index:country_,priority:1" json:"id_zone"`
|
||||
IDCurrency int32 `gorm:"column:id_currency;not null" json:"id_currency"`
|
||||
IsoCode string `gorm:"column:iso_code;not null;index:country_iso_code,priority:1" json:"iso_code"`
|
||||
CallPrefix int32 `gorm:"column:call_prefix;not null" json:"call_prefix"`
|
||||
Active bool `gorm:"column:active;not null" json:"active"`
|
||||
ContainsStates bool `gorm:"column:contains_states;not null" json:"contains_states"`
|
||||
NeedIdentificationNumber bool `gorm:"column:need_identification_number;not null" json:"need_identification_number"`
|
||||
NeedZipCode bool `gorm:"column:need_zip_code;not null;default:1" json:"need_zip_code"`
|
||||
ZipCodeFormat string `gorm:"column:zip_code_format;not null" json:"zip_code_format"`
|
||||
DisplayTaxLabel bool `gorm:"column:display_tax_label;not null" json:"display_tax_label"`
|
||||
}
|
||||
|
||||
// TableName PsCountry's table name
|
||||
func (*PsCountry) TableName() string {
|
||||
return TableNamePsCountry
|
||||
}
|
||||
|
||||
var PsCountryCols = struct {
|
||||
IDCountry gormcol.Field
|
||||
IDZone gormcol.Field
|
||||
IDCurrency gormcol.Field
|
||||
IsoCode gormcol.Field
|
||||
CallPrefix gormcol.Field
|
||||
Active gormcol.Field
|
||||
ContainsStates gormcol.Field
|
||||
NeedIdentificationNumber gormcol.Field
|
||||
NeedZipCode gormcol.Field
|
||||
ZipCodeFormat gormcol.Field
|
||||
DisplayTaxLabel gormcol.Field
|
||||
}{
|
||||
IDCountry: gormcol.Field{Table: TableNamePsCountry, Column: "id_country"},
|
||||
IDZone: gormcol.Field{Table: TableNamePsCountry, Column: "id_zone"},
|
||||
IDCurrency: gormcol.Field{Table: TableNamePsCountry, Column: "id_currency"},
|
||||
IsoCode: gormcol.Field{Table: TableNamePsCountry, Column: "iso_code"},
|
||||
CallPrefix: gormcol.Field{Table: TableNamePsCountry, Column: "call_prefix"},
|
||||
Active: gormcol.Field{Table: TableNamePsCountry, Column: "active"},
|
||||
ContainsStates: gormcol.Field{Table: TableNamePsCountry, Column: "contains_states"},
|
||||
NeedIdentificationNumber: gormcol.Field{Table: TableNamePsCountry, Column: "need_identification_number"},
|
||||
NeedZipCode: gormcol.Field{Table: TableNamePsCountry, Column: "need_zip_code"},
|
||||
ZipCodeFormat: gormcol.Field{Table: TableNamePsCountry, Column: "zip_code_format"},
|
||||
DisplayTaxLabel: gormcol.Field{Table: TableNamePsCountry, Column: "display_tax_label"},
|
||||
}
|
||||
Reference in New Issue
Block a user