| 123456789101112131415161718192021222324252627282930313233343536373839 |
- package tables
-
- import (
- "time"
-
- "git.x2erp.com/qdy/go-db/sqldef"
- )
-
- func init() {
- sqldef.AddRegistration(func(r *sqldef.Registry) {
- tb := sqldef.NewTable("dim_season", "季节波段档案表").
- ID("season_id", 32).Comment("季节波段ID,主键").End().
- String("season_code", 32).NotNull().Unique().Comment("季节编码(如:2024FA)").End().
- String("season_name", 64).NotNull().Comment("季节名称(如:2024秋冬)").End().
- Int("year").NotNull().Comment("年份").End().
- String("phase", 32).NotNull().Comment("季节(春/夏/秋/冬)").End().
- DateTime("plan_start").NotNull().Comment("季节计划开始日期").End().
- DateTime("plan_end").NotNull().Comment("季节计划结束日期").End().
- String("creator", 32).NotNull().Comment("创建人").End().
- String("tenant_id", 8).NotNull().Comment("租户ID").End().
- DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End()
- r.RegisterTable(tb.Build())
- })
- }
-
- type DimSeason struct {
- SeasonID string `gorm:"column:season_id;type:varchar(32);primaryKey;not null;comment:季节波段ID,主键"`
- SeasonCode string `gorm:"column:season_code;type:varchar(32);not null;unique;comment:季节编码(如:2024FA)"`
- SeasonName string `gorm:"column:season_name;type:varchar(64);not null;comment:季节名称(如:2024秋冬)"`
- Year int `gorm:"column:year;not null;comment:年份"`
- Phase string `gorm:"column:phase;type:varchar(32);not null;comment:季节(春/夏/秋/冬)"`
- PlanStart time.Time `gorm:"column:plan_start;not null;comment:季节计划开始日期"`
- PlanEnd time.Time `gorm:"column:plan_end;not null;comment:季节计划结束日期"`
- Creator string `gorm:"column:creator;type:varchar(32);not null;comment:创建人"`
- CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:创建时间"`
- TenantId string `gorm:"column:tenant_id;type:varchar(8);comment:租户ID"`
- }
-
- func (DimSeason) TableName() string { return "dim_season" }
|