test.sql 1.7 KB

123456789101112131415161718192021222324
  1. DROP TABLE IF EXISTS dict_data ;
  2. CREATE TABLE dict_data (
  3. id BIGINT(10) NOT NULL AUTO_INCREMENT COMMENT '序号',
  4. dict_type VARCHAR(100) NOT NULL COMMENT '字典类型',
  5. dict_label VARCHAR(100) NOT NULL COMMENT '字典标签',
  6. dict_value VARCHAR(100) NOT NULL COMMENT '字典键值',
  7. status TINYINT(1) NOT NULL COMMENT '状态',
  8. is_default CHAR(1) NOT NULL COMMENT '是否默认',
  9. sort INT(4) NOT NULL COMMENT '排序',
  10. remark VARCHAR(200) COMMENT '备注',
  11. created_by BIGINT(10) NOT NULL COMMENT '创建者',
  12. updated_by BIGINT(10) NOT NULL COMMENT '更新者',
  13. deleted_by BIGINT(10) NOT NULL COMMENT '删除者',
  14. created_at DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  15. updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  16. deleted_at DATETIME COMMENT '删除时间',
  17. deleted_flag BIT(1) DEFAULT 0 COMMENT '是否删除',
  18. PRIMARY KEY ( id ),
  19. INDEX idx_dict_type ( dict_type ),
  20. INDEX idx_dict_label ( dict_label ),
  21. INDEX idx_dict_value ( dict_value ),
  22. INDEX idx_status ( status ),
  23. INDEX idx_deleted_flag ( deleted_flag )
  24. ) COMMENT='字典数据表';