Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dic_table_field_alias_flow.go 4.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package tables
  2. import (
  3. "time"
  4. "git.x2erp.com/qdy/go-db/sqldef"
  5. )
  6. func init() {
  7. sqldef.AddRegistration(func(r *sqldef.Registry) {
  8. tb := sqldef.NewTable("dic_table_field_alias_flow", "数据库字段别名字典流水表 - 管理数据库字段别名字典审批流程").
  9. ID("id", 32).NotNull().Comment("主键").End().
  10. String("field_id", 128).NotNull().Comment("字段ID").End().
  11. String("table_id", 64).NotNull().Comment("表ID").End().
  12. String("field_name", 64).NotNull().Comment("字段名称").End().
  13. String("field_alias", 32).NotNull().Comment("字段别名").End().
  14. String("description", 500).NotNull().Default("''").Comment("字段别名描述").End().
  15. String("where_condition", 500).NotNull().Default("''").Comment("此别名获取数据的查询条件描述").End().
  16. String("tenant_id", 128).NotNull().Comment("租户ID").End().
  17. TinyInt("approval_status").NotNull().Default("0").Comment("审批状态:0待审批,1通过,2拒绝").End().
  18. String("approver", 32).NotNull().Default("''").Comment("审批人").End().
  19. DateTime("approved_at").Comment("审批时间").End().
  20. DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End().
  21. DateTime("updated_at").NotNull().Default("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP").Comment("更新时间").End().
  22. DateTime("deleted_at").Comment("删除时间").End()
  23. tb.AddIndex("idx_table_id", "table_id")
  24. tb.AddIndex("idx_field_name", "field_name")
  25. tb.AddIndex("idx_field_alias", "field_alias")
  26. tb.AddIndex("idx_tenant_id", "tenant_id")
  27. tb.AddIndex("idx_approval_status", "approval_status")
  28. r.RegisterTable(tb.Build())
  29. })
  30. }
  31. type DicTableFieldAliasFlow struct {
  32. ID string `gorm:"column:id;type:varchar(32);not null;primaryKey;comment:主键"`
  33. FieldID string `gorm:"column:field_id;type:varchar(128);not null;comment:字段ID"`
  34. TableID string `gorm:"column:table_id;type:varchar(64);not null;comment:表ID"`
  35. FieldName string `gorm:"column:field_name;type:varchar(64);not null;comment:字段名称"`
  36. FieldAlias string `gorm:"column:field_alias;type:varchar(32);not null;comment:字段别名"`
  37. Description string `gorm:"column:description;type:varchar(500);not null;default:'';comment:字段别名描述"`
  38. WhereCondition string `gorm:"column:where_condition;type:varchar(500);not null;default:'';comment:此别名获取数据的查询条件描述"`
  39. TenantID string `gorm:"column:tenant_id;type:varchar(128);not null;comment:租户ID"`
  40. ApprovalStatus int8 `gorm:"column:approval_status;type:tinyint;not null;default:0;comment:审批状态:0待审批,1通过,2拒绝"`
  41. Approver string `gorm:"column:approver;type:varchar(32);not null;default:'';comment:审批人"`
  42. ApprovedAt *time.Time `gorm:"column:approved_at;comment:审批时间"`
  43. CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:创建时间"`
  44. UpdatedAt time.Time `gorm:"column:updated_at;not null;default:CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;comment:更新时间"`
  45. DeletedAt *time.Time `gorm:"column:deleted_at;comment:删除时间"`
  46. }
  47. type DicTableFieldAliasFlowDB struct {
  48. ID string `db:"id" json:"id"`
  49. FieldID string `db:"field_id" json:"fieldID"`
  50. TableID string `db:"table_id" json:"tableID"`
  51. FieldName string `db:"field_name" json:"fieldName"`
  52. FieldAlias string `db:"field_alias" json:"fieldAlias"`
  53. Description string `db:"description" json:"description"`
  54. WhereCondition string `db:"where_condition" json:"whereCondition"`
  55. TenantID string `db:"tenant_id" json:"tenantID"`
  56. ApprovalStatus int8 `db:"approval_status" json:"approvalStatus"`
  57. Approver string `db:"approver" json:"approver"`
  58. ApprovedAt *time.Time `db:"approved_at" json:"approvedAt"`
  59. CreatedAt time.Time `db:"created_at" json:"createdAt"`
  60. UpdatedAt time.Time `db:"updated_at" json:"updatedAt"`
  61. DeletedAt *time.Time `db:"deleted_at" json:"deletedAt"`
  62. }
  63. func (DicTableFieldAliasFlow) TableName() string {
  64. return "dic_table_field_alias_flow"
  65. }