| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- package tables
-
- import (
- "time"
-
- "git.x2erp.com/qdy/go-db/sqldef"
- )
-
- func init() {
- sqldef.AddRegistration(func(r *sqldef.Registry) {
- tb := sqldef.NewTable("sync_solution_sql", "同步SQL代码表 - 存储数据仓库同步脚本").
- ID("id", 128).NotNull().Comment("主键").End().
- String("sync_id", 50).NotNull().Comment("同步代码").End().
- String("sync_name", 100).NotNull().Comment("同步名称").End().
- String("solution_id", 32).NotNull().Comment("方案代码").End().
- Text("code_sql").NotNull().Comment("SQL代码").End().
- Text("count_sql").NotNull().Comment("统计记录总SQL代码").End().
- TinyInt("is_active").NotNull().Default("1").Comment("是否启用: 1启用,0禁用").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_sync_id", "sync_id")
- tb.AddIndex("idx_solution_id", "solution_id")
-
- r.RegisterTable(tb.Build())
- })
- }
-
- type SyncSolutionSQL struct {
- SyncID string `gorm:"column:sync_id;type:varchar(50);not null;primaryKey;comment:同步代码"`
- SyncName string `gorm:"column:sync_name;type:varchar(100);not null;comment:同步名称"`
- SolutionID string `gorm:"column:solution_id;type:varchar(32);not null;comment:方案代码"`
- CodeSQL string `gorm:"column:code_sql;type:text;not null;comment:SQL代码"`
- CountSQL string `gorm:"column:count_sql;type:text;not null;comment:统计记录总SQL代码"`
- IsActive int8 `gorm:"column:is_active;type:tinyint;not null;default:1;comment:是否启用: 1启用,0禁用"`
- 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 SyncSolutionSQLDB struct {
- ID string `db:"id" json:"id"`
- SyncID string `db:"sync_id" json:"syncID"`
- SyncName string `db:"sync_name" json:"syncName"`
- SolutionID string `db:"solution_id" json:"solutionID"`
- CodeSQL string `db:"code_sql" json:"codeSQL"`
- CountSQL string `db:"count_sql" json:"countSQL"`
- IsActive int8 `db:"is_active" json:"isActive"`
- 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 (SyncSolutionSQL) TableName() string {
- return "sync_solution_sql"
- }
|