| 1234567891011121314151617181920212223242526272829303132333435363738 |
- package tables
-
- import (
- "time"
-
- "git.x2erp.com/qdy/go-db/sqldef"
- )
-
- func init() {
- sqldef.AddRegistration(func(r *sqldef.Registry) {
- tb := sqldef.NewTable("config_channel", "渠道档案表").
- ID("channel_id", 32).Comment("渠道编码,主键").End().
- String("channel_name", 64).NotNull().Comment("渠道名称(如:天猫旗舰店)").End().
- String("channel_type", 32).NotNull().Comment("渠道类型(如:线上/线下/奥莱)").End().
- String("store_id", 32).Comment("关联门店/仓库ID,对应ERP编码").End().
- String("tenant_id", 8).NotNull().Comment("租户ID").End().
- String("store_group_id", 32).NotNull().Comment("所属店铺组").End().
- String("creator", 32).NotNull().Comment("创建人").End().
- DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End()
- r.RegisterTable(tb.Build())
- })
- }
-
- // ConfigChannel 渠道档案表结构体
- type ConfigChannel struct {
- ChannelID string `gorm:"column:channel_id;type:varchar(32);primaryKey;not null;comment:渠道编码,主键"`
- ChannelName string `gorm:"column:channel_name;type:varchar(64);not null;comment:渠道名称(如:天猫旗舰店)"`
- ChannelType string `gorm:"column:channel_type;type:varchar(32);not null;comment:渠道类型(如:线上/线下/奥莱)"`
- StoreID string `gorm:"column:store_id;type:varchar(32);comment:关联门店/仓库ID,对应ERP编码"`
- TenantId string `gorm:"column:tenant_id;type:varchar(8);comment:租户ID"`
- Creator string `gorm:"column:creator;type:varchar(32);not null;comment:创建人"`
- CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:创建时间"`
- StoreGroupID string `gorm:"column:store_group_id;type:varchar(32);comment:所属店铺组"`
- }
-
- func (ConfigChannel) TableName() string {
- return "config_channel"
- }
|