| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package tables
-
- import (
- "time"
-
- "git.x2erp.com/qdy/go-db/sqldef"
- )
-
- func init() {
- sqldef.AddRegistration(func(r *sqldef.Registry) {
- tb := sqldef.NewTable("sync_solution", "同步方案主表 - 管理不同的数据同步方案").
- ID("id", 128).NotNull().Comment("主键").End().
- String("solution_code", 32).NotNull().Comment("方案代码").End().
- String("solution_type", 20).NotNull().Comment("方案类型: 全量,增量,计算").End().
- String("solution_name", 100).NotNull().Comment("方案名称").End().
- String("description", 500).NotNull().Default("''").Comment("方案描述").End().
- String("creator", 32).NotNull().Comment("创建人").End().
- DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End().
- DateTime("updated_at").NotNull().Default("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").Comment("更新时间").End().
- DateTime("deleted_at").Comment("删除时间").End()
-
- tb.AddIndex("idx_solution_code", "solution_code")
-
- r.RegisterTable(tb.Build())
- })
- }
-
- type SyncSolution struct {
- SolutionCode string `gorm:"column:solution_code;type:varchar(32);not null;primaryKey;comment:方案代码"`
- SolutionType string `gorm:"column:solution_type;type:varchar(20);not null;comment:方案类型: 全量,增量,计算"`
- SolutionName string `gorm:"column:solution_name;type:varchar(100);not null;comment:方案名称"`
- Description string `gorm:"column:description;type:varchar(500);not null;default:'';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:创建时间"`
- UpdatedAt time.Time `gorm:"column:updated_at;not null;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;comment:更新时间"`
- DeletedAt *time.Time `gorm:"column:deleted_at;comment:删除时间"`
- }
-
- type SyncSolutionDB struct {
- ID string `db:"id" json:"id"`
- SolutionCode string `db:"solution_code" json:"solutionCode"`
- SolutionType string `db:"solution_type" json:"solutionType"`
- SolutionName string `db:"solution_name" json:"solutionName"`
- Description string `db:"description" json:"description"`
- Creator string `db:"creator" json:"creator"`
- CreatedAt time.Time `db:"created_at" json:"createdAt"`
- UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
- DeletedAt *time.Time `db:"deleted_at" json:"deletedAt"`
- }
-
- func (SyncSolution) TableName() string {
- return "sync_solution"
- }
|