global-dict-script.sql 2.0 KB

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