package tables import ( "time" "git.x2erp.com/qdy/go-db/sqldef" ) func init() { sqldef.AddRegistration(func(r *sqldef.Registry) { tb := sqldef.NewTable("dim_depot", "店铺档案表"). ID("dim_depot_id", 32).Comment("店铺编码主键").End(). String("depot_id", 32).Comment("店铺编码").End(). String("depot_name", 64).NotNull().Comment("渠道名称(如:天猫旗舰店)").End(). String("depot_type", 32).NotNull().Comment("渠道类型(如:线上/线下/奥莱)").End(). String("tenant_id", 8).NotNull().Comment("租户ID").End(). String("city_id", 32).NotNull().Comment("店铺所在城市").End(). String("depot_address", 32).NotNull().Comment("店铺地址").End(). String("creator", 32).NotNull().Comment("创建人").End(). DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End() r.RegisterTable(tb.Build()) }) } // DimDepot 店铺档案表结构体(原ConfigChannel调整为匹配表结构) type DimDepot struct { DimDepotID string `gorm:"column:dim_depot_id;type:varchar(32);primaryKey;comment:店铺编码主键"` DepotID string `gorm:"column:depot_id;type:varchar(32);comment:店铺编码"` DepotName string `gorm:"column:depot_name;type:varchar(64);not null;comment:渠道名称(如:天猫旗舰店)"` DepotType string `gorm:"column:depot_type;type:varchar(32);not null;comment:渠道类型(如:线上/线下/奥莱)"` TenantID string `gorm:"column:tenant_id;type:varchar(8);not null;comment:租户ID"` CityID string `gorm:"column:city_id;type:varchar(32);not null;comment:店铺所在城市"` DepotAddress string `gorm:"column:depot_address;type:varchar(32);not null;comment:店铺地址"` Creator string `gorm:"column:creator;type:varchar(32);not null;comment:创建人"` CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间"` } func (DimDepot) TableName() string { return "dim_depot" }