global-dict-script.sql 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. SET NAMES utf8mb4;
  2. SET FOREIGN_KEY_CHECKS = 0;
  3. -- ----------------------------
  4. -- 全局字典表
  5. -- ----------------------------
  6. DROP TABLE IF EXISTS `zz_global_dict`;
  7. CREATE TABLE `zz_global_dict`
  8. (
  9. `dict_id` bigint(20) NOT NULL COMMENT '主键Id',
  10. `dict_code` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '字典编码',
  11. `dict_name` varchar(2048) COLLATE utf8mb4_bin NOT NULL COMMENT '字典中文名称',
  12. `create_user_id` bigint(20) NOT NULL COMMENT '创建用户Id',
  13. `create_time` datetime NOT NULL COMMENT '创建时间',
  14. `update_user_id` bigint(20) NOT NULL COMMENT '更新用户名',
  15. `update_time` datetime NOT NULL COMMENT '更新时间',
  16. `deleted_flag` int NOT NULL COMMENT '逻辑删除字段',
  17. PRIMARY KEY (`dict_id`),
  18. KEY `idx_dict_code` (`dict_code`) USING BTREE
  19. ) ENGINE = InnoDB
  20. DEFAULT CHARSET = utf8mb4
  21. COLLATE = utf8mb4_bin COMMENT ='全局字典表';
  22. -- ----------------------------
  23. -- 全局字典项目表
  24. -- ----------------------------
  25. DROP TABLE IF EXISTS `zz_global_dict_item`;
  26. CREATE TABLE `zz_global_dict_item`
  27. (
  28. `id` bigint(20) NOT NULL COMMENT '主键Id',
  29. `dict_code` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '字典编码',
  30. `item_id` varchar(64) NOT NULL COMMENT '字典数据项Id',
  31. `item_name` varchar(1024) COLLATE utf8mb4_bin NOT NULL COMMENT '字典数据项名称',
  32. `show_order` int NOT NULL COMMENT '显示顺序',
  33. `status` int NOT NULL COMMENT '字典状态',
  34. `create_user_id` bigint(20) NOT NULL COMMENT '创建用户Id',
  35. `create_time` datetime NOT NULL COMMENT '创建时间',
  36. `update_user_id` bigint(20) NOT NULL COMMENT '更新用户名',
  37. `update_time` datetime NOT NULL COMMENT '更新时间',
  38. `deleted_flag` int NOT NULL COMMENT '逻辑删除字段',
  39. PRIMARY KEY (`id`),
  40. KEY `idx_show_order` (`show_order`) USING BTREE,
  41. KEY `idx_dict_code_item_id` (`dict_code`, `item_id`) USING BTREE
  42. ) ENGINE = InnoDB
  43. DEFAULT CHARSET = utf8mb4
  44. COLLATE = utf8mb4_bin COMMENT ='全局字典项目表';
  45. SET FOREIGN_KEY_CHECKS = 1;