Use table name constant in Cols for type safety
This commit is contained in:
46
app/model/dbmodel/ps_delivery.go
Normal file
46
app/model/dbmodel/ps_delivery.go
Normal file
@@ -0,0 +1,46 @@
|
||||
// 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 TableNamePsDelivery = "ps_delivery"
|
||||
|
||||
// PsDelivery mapped from table <ps_delivery>
|
||||
type PsDelivery struct {
|
||||
IDDelivery int32 `gorm:"column:id_delivery;primaryKey;autoIncrement:true" json:"id_delivery"`
|
||||
IDShop *int32 `gorm:"column:id_shop" json:"id_shop"`
|
||||
IDShopGroup *int32 `gorm:"column:id_shop_group" json:"id_shop_group"`
|
||||
IDCarrier int32 `gorm:"column:id_carrier;not null;index:id_carrier,priority:1" json:"id_carrier"`
|
||||
IDRangePrice *int32 `gorm:"column:id_range_price;index:id_range_price,priority:1" json:"id_range_price"`
|
||||
IDRangeWeight *int32 `gorm:"column:id_range_weight;index:id_range_weight,priority:1" json:"id_range_weight"`
|
||||
IDZone int32 `gorm:"column:id_zone;not null;index:id_carrier,priority:2;index:id_zone,priority:1" json:"id_zone"`
|
||||
Price float64 `gorm:"column:price;not null" json:"price"`
|
||||
}
|
||||
|
||||
// TableName PsDelivery's table name
|
||||
func (*PsDelivery) TableName() string {
|
||||
return TableNamePsDelivery
|
||||
}
|
||||
|
||||
var PsDeliveryCols = struct {
|
||||
IDDelivery gormcol.Field
|
||||
IDShop gormcol.Field
|
||||
IDShopGroup gormcol.Field
|
||||
IDCarrier gormcol.Field
|
||||
IDRangePrice gormcol.Field
|
||||
IDRangeWeight gormcol.Field
|
||||
IDZone gormcol.Field
|
||||
Price gormcol.Field
|
||||
}{
|
||||
IDDelivery: gormcol.Field{Table: TableNamePsDelivery, Column: "id_delivery"},
|
||||
IDShop: gormcol.Field{Table: TableNamePsDelivery, Column: "id_shop"},
|
||||
IDShopGroup: gormcol.Field{Table: TableNamePsDelivery, Column: "id_shop_group"},
|
||||
IDCarrier: gormcol.Field{Table: TableNamePsDelivery, Column: "id_carrier"},
|
||||
IDRangePrice: gormcol.Field{Table: TableNamePsDelivery, Column: "id_range_price"},
|
||||
IDRangeWeight: gormcol.Field{Table: TableNamePsDelivery, Column: "id_range_weight"},
|
||||
IDZone: gormcol.Field{Table: TableNamePsDelivery, Column: "id_zone"},
|
||||
Price: gormcol.Field{Table: TableNamePsDelivery, Column: "price"},
|
||||
}
|
||||
Reference in New Issue
Block a user