update.sql 5.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. -- 更新大屏配置的类名
  2. UPDATE big_screen_page SET config = REPLACE(config, '"className":"com.gccloud.bigscreen', '"className":"com.gccloud.dataroom');
  3. UPDATE big_screen_page SET config = REPLACE(config, '"className":"com.gccloud.dataroom.core.module.manage.dto.BigScreenPageDTO', '"className":"com.gccloud.dataroom.core.module.manage.dto.DataRoomPageDTO');
  4. -- 新增数据集相关的表
  5. DROP TABLE IF EXISTS `ds_category_tree`;
  6. CREATE TABLE `ds_category_tree` (
  7. `id` bigint(64) NOT NULL AUTO_INCREMENT COMMENT '主键',
  8. `ids` text COMMENT 'id序列',
  9. `name` varchar(255) DEFAULT NULL COMMENT '名称',
  10. `parent_id` bigint(64) DEFAULT NULL COMMENT '父级ID',
  11. `type` varchar(255) NOT NULL,
  12. `module_code` varchar(255) DEFAULT NULL,
  13. `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  14. `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  15. `del_flag` tinyint(2) NOT NULL DEFAULT '0' COMMENT '删除标识',
  16. PRIMARY KEY (`id`) USING BTREE
  17. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据集种类树';
  18. DROP TABLE IF EXISTS `ds_datasource`;
  19. CREATE TABLE `ds_datasource` (
  20. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  21. `source_name` varchar(255) DEFAULT NULL COMMENT '数据源名称',
  22. `source_type` varchar(255) DEFAULT NULL COMMENT '数据源类型',
  23. `driver_class_name` varchar(255) DEFAULT NULL COMMENT '连接驱动',
  24. `url` varchar(255) DEFAULT NULL COMMENT '连接url',
  25. `host` varchar(255) DEFAULT NULL COMMENT '主机',
  26. `port` int(16) DEFAULT NULL COMMENT '端口',
  27. `username` varchar(255) DEFAULT NULL COMMENT '用户名',
  28. `password` text COMMENT '密码',
  29. `module_code` varchar(255) DEFAULT NULL COMMENT '模块编码',
  30. `editable` tinyint(2) DEFAULT '0' COMMENT '是否可编辑,0 不可编辑 1 可编辑',
  31. `remark` varchar(255) DEFAULT NULL,
  32. `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  33. `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  34. `del_flag` tinyint(2) NOT NULL DEFAULT '0' COMMENT '删除标识',
  35. PRIMARY KEY (`id`) USING BTREE
  36. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据源配置表';
  37. DROP TABLE IF EXISTS `ds_dataset`;
  38. CREATE TABLE `ds_dataset` (
  39. `id` bigint(32) NOT NULL AUTO_INCREMENT COMMENT '主键',
  40. `name` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '名称',
  41. `code` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '编码',
  42. `type_id` varchar(255) DEFAULT NULL COMMENT '种类ID',
  43. `remark` text CHARACTER SET utf8 COMMENT '描述',
  44. `dataset_type` varchar(64) CHARACTER SET utf8 NOT NULL COMMENT '数据集类型(自定义数据集 custom、模型数据集model、原始数据集original、API数据集api、JSON数据集 json)',
  45. `module_code` varchar(255) COLLATE utf8_general_mysql500_ci DEFAULT NULL COMMENT '模块编码',
  46. `editable` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否可编辑,0 不可编辑 1 可编辑',
  47. `source_id` bigint(32) DEFAULT NULL COMMENT '数据源ID',
  48. `cache` tinyint(1) DEFAULT 0 NOT NULL COMMENT '是否对执行结构缓存 0 不缓存 1 缓存',
  49. `config` longtext COMMENT '数据集配置',
  50. `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  51. `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  52. `del_flag` tinyint(2) NOT NULL DEFAULT '0' COMMENT '删除标识',
  53. PRIMARY KEY (`id`) USING BTREE
  54. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_mysql500_ci COMMENT='数据集表';
  55. # 20230705 添加create_by、update_by
  56. ALTER TABLE `big_screen_page` ADD COLUMN `create_by` bigint(64) NULL DEFAULT 2 COMMENT '创建人' AFTER `del_flag`;
  57. ALTER TABLE `big_screen_page` ADD COLUMN `update_by` bigint(64) NULL DEFAULT 2 COMMENT '更新人' AFTER `create_by`;
  58. ALTER TABLE `big_screen_file` ADD COLUMN `create_by` bigint(64) NULL DEFAULT 2 COMMENT '创建人' AFTER `del_flag`;
  59. ALTER TABLE `big_screen_file` ADD COLUMN `update_by` bigint(64) NULL DEFAULT 2 COMMENT '更新人' AFTER `create_by`;
  60. ALTER TABLE `big_screen_biz_component` ADD COLUMN `create_by` bigint(64) NULL DEFAULT 2 COMMENT '创建人' AFTER `del_flag`;
  61. ALTER TABLE `big_screen_biz_component` ADD COLUMN `update_by` bigint(64) NULL DEFAULT 2 COMMENT '更新人' AFTER `create_by`;
  62. ALTER TABLE `big_screen_page_template` ADD COLUMN `create_by` bigint(64) NULL DEFAULT 2 COMMENT '创建人' AFTER `del_flag`;
  63. ALTER TABLE `big_screen_page_template` ADD COLUMN `update_by` bigint(64) NULL DEFAULT 2 COMMENT '更新人' AFTER `create_by`;
  64. ALTER TABLE `big_screen_type` ADD COLUMN `create_by` bigint(64) NULL DEFAULT 2 COMMENT '创建人' AFTER `del_flag`;
  65. ALTER TABLE `big_screen_type` ADD COLUMN `update_by` bigint(64) NULL DEFAULT 2 COMMENT '更新人' AFTER `create_by`;
  66. ALTER TABLE `ds_datasource` ADD COLUMN `create_by` bigint(64) NULL DEFAULT 2 COMMENT '创建人' AFTER `del_flag`;
  67. ALTER TABLE `ds_datasource` ADD COLUMN `update_by` bigint(64) NULL DEFAULT 2 COMMENT '更新人' AFTER `create_by`;
  68. ALTER TABLE `ds_dataset` ADD COLUMN `create_by` bigint(64) NULL DEFAULT 2 COMMENT '创建人' AFTER `del_flag`;
  69. ALTER TABLE `ds_dataset` ADD COLUMN `update_by` bigint(64) NULL DEFAULT 2 COMMENT '更新人' AFTER `create_by`;
  70. ALTER TABLE `ds_category_tree` ADD COLUMN `create_by` bigint(64) NULL DEFAULT 2 COMMENT '创建人' AFTER `del_flag`;
  71. ALTER TABLE `ds_category_tree` ADD COLUMN `update_by` bigint(64) NULL DEFAULT 2 COMMENT '更新人' AFTER `create_by`;