bladex-update-mysql-3.0.0~3.0.1.sql 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. -- -----------------------------------
  2. -- 修改 代码生成表字段类型
  3. -- -----------------------------------
  4. ALTER TABLE `blade_code`
  5. CHANGE COLUMN `datasource_id` `model_id` bigint(20) NULL DEFAULT NULL COMMENT '数据模型主键' AFTER `id`;
  6. -- -----------------------------------
  7. -- 新增 代码生成表字段类型
  8. -- -----------------------------------
  9. ALTER TABLE `blade_code`
  10. ADD COLUMN `template_type` varchar(32) NULL COMMENT '模版类型' AFTER `package_name`,
  11. ADD COLUMN `author` varchar(32) NULL COMMENT '作者信息' AFTER `template_type`,
  12. ADD COLUMN `sub_model_id` varchar(32) NULL COMMENT '子表模型主键' AFTER `author`,
  13. ADD COLUMN `sub_fk_id` varchar(32) NULL COMMENT '子表绑定外键' AFTER `sub_model_id`,
  14. ADD COLUMN `tree_id` varchar(32) NULL COMMENT '树主键字段' AFTER `sub_fk_id`,
  15. ADD COLUMN `tree_pid` varchar(32) NULL COMMENT '树父主键字段' AFTER `tree_id`,
  16. ADD COLUMN `tree_name` varchar(64) NULL COMMENT '树名称字段' AFTER `tree_pid`;
  17. -- -----------------------------------
  18. -- 新增模型设计菜单
  19. -- -----------------------------------
  20. INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES (1161272593873321996, 1123598815738675217, 'model', '数据模型设计', 'menu', '/tool/model', 'iconfont icon-biaodan', 3, 1, 0, 1, '', '', 0);
  21. -- -----------------------------------
  22. -- 新增 数据模型表
  23. -- -----------------------------------
  24. CREATE TABLE `blade_model` (
  25. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  26. `datasource_id` bigint(20) NULL DEFAULT NULL COMMENT '数据源主键',
  27. `model_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型名称',
  28. `model_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型编号',
  29. `model_table` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物理表名',
  30. `model_class` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型类名',
  31. `model_remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型备注',
  32. `create_user` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  33. `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
  34. `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  35. `update_user` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
  36. `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
  37. `status` int(2) NULL DEFAULT NULL COMMENT '状态',
  38. `is_deleted` int(2) NULL DEFAULT NULL COMMENT '是否已删除',
  39. PRIMARY KEY (`id`)
  40. ) COMMENT = '数据模型表';
  41. -- -----------------------------------
  42. -- 新增 数据原型表
  43. -- -----------------------------------
  44. CREATE TABLE `blade_model_prototype` (
  45. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  46. `model_id` bigint(20) NULL DEFAULT NULL COMMENT '模型主键',
  47. `jdbc_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物理列名',
  48. `jdbc_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物理类型',
  49. `comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '注释说明',
  50. `property_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '实体类型',
  51. `property_entity` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '实体类型引用',
  52. `property_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '实体列名',
  53. `is_list` int(2) NULL DEFAULT NULL COMMENT '列表显示',
  54. `is_form` int(2) NULL DEFAULT NULL COMMENT '表单显示',
  55. `is_row` int(2) NULL DEFAULT NULL COMMENT '独占一行',
  56. `component_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组件类型',
  57. `dict_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字典编码',
  58. `is_required` int(2) NULL DEFAULT NULL COMMENT '是否必填',
  59. `is_query` int(2) NULL DEFAULT NULL COMMENT '查询配置',
  60. `query_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '查询类型',
  61. `create_user` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
  62. `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
  63. `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  64. `update_user` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
  65. `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
  66. `status` int(2) NULL DEFAULT NULL COMMENT '状态',
  67. `is_deleted` int(2) NULL DEFAULT NULL COMMENT '是否已删除',
  68. PRIMARY KEY (`id`)
  69. ) COMMENT = '数据原型表';