diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/ChartDO.java b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/ChartDO.java index e1b28625a..dac8b8526 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/ChartDO.java +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/ChartDO.java @@ -1,6 +1,7 @@ package ai.chat2db.server.domain.repository.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; @@ -52,6 +53,7 @@ public class ChartDO implements Serializable { /** * 图表信息 */ + @TableField("`schema`") private String schema; /** diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/DashboardDO.java b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/DashboardDO.java index 5d4cd4df0..625042738 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/DashboardDO.java +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/DashboardDO.java @@ -1,6 +1,7 @@ package ai.chat2db.server.domain.repository.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; @@ -52,6 +53,7 @@ public class DashboardDO implements Serializable { /** * 报表布局信息 */ + @TableField("`schema`") private String schema; /** diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/DataSourceDO.java b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/DataSourceDO.java index 88c4e10f5..876629fca 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/DataSourceDO.java +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/DataSourceDO.java @@ -1,6 +1,7 @@ package ai.chat2db.server.domain.repository.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; @@ -92,6 +93,7 @@ public class DataSourceDO implements Serializable { /** * ssl配置信息json */ + @TableField("`ssl`") private String ssl; /** diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/TableVectorMappingDO.java b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/TableVectorMappingDO.java index fb020c14f..88503d699 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/TableVectorMappingDO.java +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/TableVectorMappingDO.java @@ -1,6 +1,7 @@ package ai.chat2db.server.domain.repository.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; @@ -46,6 +47,7 @@ public class TableVectorMappingDO implements Serializable { /** * schema名称 */ + @TableField("`schema`") private String schema; /** diff --git "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_0__\345\210\235\345\247\213\345\214\226\344\277\241\346\201\257.sql" "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_0__\345\210\235\345\247\213\345\214\226\344\277\241\346\201\257.sql" index ffd95012a..f594cb67b 100644 --- "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_0__\345\210\235\345\247\213\345\214\226\344\277\241\346\201\257.sql" +++ "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_0__\345\210\235\345\247\213\345\214\226\344\277\241\346\201\257.sql" @@ -1,5 +1,5 @@ CREATE TABLE IF NOT EXISTS `data_source` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL COMMENT '创建时间', `gmt_modified` datetime NOT NULL COMMENT '修改时间', `alias` varchar(128) DEFAULT NULL COMMENT '别名', @@ -8,43 +8,43 @@ CREATE TABLE IF NOT EXISTS `data_source` ( `password` varchar(256) DEFAULT NULL COMMENT '密码', `type` varchar(32) DEFAULT NULL COMMENT '数据库类型', `env_type` varchar(32) DEFAULT NULL COMMENT '环境类型', - `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户id', + `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '用户id', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='数据源连接表' ; CREATE TABLE IF NOT EXISTS `operation_log` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `data_source_id` bigint(20) unsigned NOT NULL COMMENT '数据源连接ID', + `data_source_id` bigint unsigned NOT NULL COMMENT '数据源连接ID', `database_name` varchar(128) DEFAULT NULL COMMENT 'db名称', `type` varchar(32) NOT NULL COMMENT '数据库类型', `ddl` text DEFAULT NULL COMMENT 'ddl内容', - `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户id', + `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '用户id', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='我的执行记录表' ; CREATE TABLE IF NOT EXISTS `operation_saved` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `data_source_id` bigint(20) unsigned NOT NULL COMMENT '数据源连接ID', + `data_source_id` bigint unsigned NOT NULL COMMENT '数据源连接ID', `database_name` varchar(128) DEFAULT NULL COMMENT 'db名称', `name` varchar(128) DEFAULT NULL COMMENT '保存名称', `type` varchar(32) NOT NULL COMMENT '数据库类型', `status` varchar(32) NOT NULL COMMENT 'ddl语句状态:DRAFT/RELEASE', `ddl` text DEFAULT NULL COMMENT 'ddl内容', `tab_opened` text DEFAULT NULL COMMENT '是否在tab中被打开,y表示打开,n表示未打开', - `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户id', + `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '用户id', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='我的保存表' ; CREATE TABLE IF NOT EXISTS `dbhub_user` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `user_name` varchar(32) NOT NULL COMMENT '用户名', @@ -56,7 +56,7 @@ CREATE TABLE IF NOT EXISTS `dbhub_user` ( ; CREATE TABLE IF NOT EXISTS `system_config` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `code` varchar(32) NOT NULL COMMENT '配置项编码', diff --git "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_4__\345\242\236\345\212\240\346\212\245\350\241\250.sql" "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_4__\345\242\236\345\212\240\346\212\245\350\241\250.sql" index f644d69fd..39d085ddb 100644 --- "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_4__\345\242\236\345\212\240\346\212\245\350\241\250.sql" +++ "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_4__\345\242\236\345\212\240\346\212\245\350\241\250.sql" @@ -1,39 +1,39 @@ CREATE TABLE IF NOT EXISTS `dashboard` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `name` varchar(128) DEFAULT NULL COMMENT '报表名称', `description` varchar(128) DEFAULT NULL COMMENT '报表描述', `schema` text DEFAULT NULL COMMENT '报表布局信息', `deleted` text DEFAULT NULL COMMENT '是否被删除,y表示删除,n表示未删除', - `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户id', + `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '用户id', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='自定义报表表' ; CREATE TABLE IF NOT EXISTS `chart` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `name` varchar(128) DEFAULT NULL COMMENT '图表名称', `description` varchar(128) DEFAULT NULL COMMENT '图表描述', `schema` text DEFAULT NULL COMMENT '图表信息', - `data_source_id` bigint(20) unsigned DEFAULT NULL COMMENT '数据源连接ID', + `data_source_id` bigint unsigned DEFAULT NULL COMMENT '数据源连接ID', `type` varchar(32) DEFAULT NULL COMMENT '数据库类型', `database_name` varchar(128) DEFAULT NULL COMMENT 'db名称', `ddl` text DEFAULT NULL COMMENT 'ddl内容', `deleted` text DEFAULT NULL COMMENT '是否被删除,y表示删除,n表示未删除', - `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户id', + `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '用户id', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='自定义报表表' ; CREATE TABLE IF NOT EXISTS `dashboard_chart_relation` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `dashboard_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '报表id', - `chart_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '图表id', + `dashboard_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '报表id', + `chart_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '图表id', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='自定义报表表' ; diff --git "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_5__\345\242\236\345\212\240\347\275\256\351\241\266\350\241\250.sql" "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_5__\345\242\236\345\212\240\347\275\256\351\241\266\350\241\250.sql" index ba90e9323..a1ac86adc 100644 --- "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_5__\345\242\236\345\212\240\347\275\256\351\241\266\350\241\250.sql" +++ "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_5__\345\242\236\345\212\240\347\275\256\351\241\266\350\241\250.sql" @@ -1,13 +1,13 @@ CREATE TABLE IF NOT EXISTS `pin_table` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `data_source_id` bigint(20) unsigned NOT NULL COMMENT '数据源连接ID', + `data_source_id` bigint unsigned NOT NULL COMMENT '数据源连接ID', `database_name` varchar(128) DEFAULT NULL COMMENT 'db名称', `schema_name` varchar(128) DEFAULT NULL COMMENT 'schema名称', `table_name` varchar(128) DEFAULT NULL COMMENT 'table_name', `deleted` text DEFAULT NULL COMMENT '是否被删除,y表示删除,n表示未删除', - `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户id', + `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '用户id', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='PIN TABLES' ; diff --git "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_6__\345\210\235\345\247\213\345\214\226demo\344\277\241\346\201\257.sql" "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_6__\345\210\235\345\247\213\345\214\226demo\344\277\241\346\201\257.sql" index 5dcff8870..0e10f207c 100644 --- "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_6__\345\210\235\345\247\213\345\214\226demo\344\277\241\346\201\257.sql" +++ "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_6__\345\210\235\345\247\213\345\214\226demo\344\277\241\346\201\257.sql" @@ -1,16 +1,16 @@ INSERT INTO DATA_SOURCE (GMT_CREATE, GMT_MODIFIED, ALIAS, URL, USER_NAME, PASSWORD, TYPE, USER_ID, HOST, PORT, SSH,JDBC) VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'DEMO@db.sqlgpt.cn', 'jdbc:mysql://db.sqlgpt.cn:3306/DEMO', 'demo', 'kok39AYoOSM=', 'MYSQL', 0, 'db.sqlgpt.cn', '3306', '{"use":false}', '8.0'); -INSERT INTO DASHBOARD (ID, GMT_CREATE, GMT_MODIFIED, NAME, DESCRIPTION, SCHEMA, DELETED, USER_ID) +INSERT INTO DASHBOARD (ID, GMT_CREATE, GMT_MODIFIED, NAME, DESCRIPTION, `SCHEMA`, DELETED, USER_ID) VALUES (1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '学生成绩分析', '学生成绩分析', '[[1],[2],[3]]', 'N', 0); -INSERT INTO CHART (ID, GMT_CREATE, GMT_MODIFIED, SCHEMA, DATA_SOURCE_ID, DATABASE_NAME, DDL, DELETED, USER_ID) +INSERT INTO CHART (ID, GMT_CREATE, GMT_MODIFIED, `SCHEMA`, DATA_SOURCE_ID, DATABASE_NAME, DDL, DELETED, USER_ID) VALUES (1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '{"chartType":"Column","xAxis":"name","yAxis":"total_score"}', 1, 'DEMO', 'SELECT s.name, sc.chinese_score, sc.math_score, sc.english_score, sc.science_score, sc.humanities_score, (sc.chinese_score + sc.math_score + sc.english_score + sc.science_score + sc.humanities_score) AS total_score FROM student s JOIN score sc ON s.id = sc.student_id', 'N', 0); -INSERT INTO CHART (ID, GMT_CREATE, GMT_MODIFIED, SCHEMA, DATA_SOURCE_ID, DATABASE_NAME, DDL, DELETED, USER_ID) +INSERT INTO CHART (ID, GMT_CREATE, GMT_MODIFIED, `SCHEMA`, DATA_SOURCE_ID, DATABASE_NAME, DDL, DELETED, USER_ID) VALUES (2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '{"chartType":"Pie","xAxis":"grade"}', 1, 'DEMO', 'SELECT s.name, score.chinese_score, score.math_score, @@ -27,7 +27,7 @@ VALUES (2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '{"chartType":"Pie","xAxis":"gr FROM score JOIN student s ON score.student_id = s.id', 'N', 0); -INSERT INTO CHART (ID, GMT_CREATE, GMT_MODIFIED, SCHEMA, DATA_SOURCE_ID, DATABASE_NAME, DDL, DELETED, USER_ID) +INSERT INTO CHART (ID, GMT_CREATE, GMT_MODIFIED, `SCHEMA`, DATA_SOURCE_ID, DATABASE_NAME, DDL, DELETED, USER_ID) VALUES (3, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '{"chartType":"Line","xAxis":"name","yAxis":"chinese_score"}', 1, 'DEMO', 'SELECT s.name, sc.chinese_score, sc.math_score, sc.english_score, sc.science_score, sc.humanities_score, (sc.chinese_score + sc.math_score + sc.english_score + sc.science_score + sc.humanities_score) AS total_score FROM student s diff --git "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_7__\350\207\252\345\256\232\344\271\211\351\251\261\345\212\250.sql" "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_7__\350\207\252\345\256\232\344\271\211\351\251\261\345\212\250.sql" index af4c1d0ed..156957a37 100644 --- "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_7__\350\207\252\345\256\232\344\271\211\351\251\261\345\212\250.sql" +++ "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V1_0_7__\350\207\252\345\256\232\344\271\211\351\251\261\345\212\250.sql" @@ -1,5 +1,5 @@ CREATE TABLE IF NOT EXISTS `jdbc_driver` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', `db_type` varchar(32) NOT NULL COMMENT 'db类型', diff --git "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_0__\346\224\257\346\214\201\347\216\257\345\242\203\343\200\201\347\224\250\346\210\267\346\235\203\351\231\220.sql" "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_0__\346\224\257\346\214\201\347\216\257\345\242\203\343\200\201\347\224\250\346\210\267\346\235\203\351\231\220.sql" index e7b895b69..6528ad01f 100644 --- "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_0__\346\224\257\346\214\201\347\216\257\345\242\203\343\200\201\347\224\250\346\210\267\346\235\203\351\231\220.sql" +++ "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_0__\346\224\257\346\214\201\347\216\257\345\242\203\343\200\201\347\224\250\346\210\267\346\235\203\351\231\220.sql" @@ -1,11 +1,11 @@ CREATE TABLE IF NOT EXISTS `environment` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `create_user_id` bigint(20) unsigned NOT NULL COMMENT '创建人用户id', - `modified_user_id` bigint(20) unsigned NOT NULL COMMENT '修改人用户id', - `name` varchar(128) DEFAULT NOT NULL COMMENT '环境名称', + `create_user_id` bigint unsigned NOT NULL COMMENT '创建人用户id', + `modified_user_id` bigint unsigned NOT NULL COMMENT '修改人用户id', + `name` varchar(128) NOT NULL DEFAULT '' COMMENT '环境名称', `short_name` varchar(128) DEFAULT NULL COMMENT '环境缩写', `color` varchar(32) DEFAULT NULL COMMENT '颜色', PRIMARY KEY (`id`) @@ -21,10 +21,10 @@ INSERT INTO `environment` VALUES (2, 1, 1, 'Test Environment', 'TEST', 'GREEN'); ALTER TABLE `data_source` - ADD COLUMN `environment_id` bigint(20) unsigned NOT NULL DEFAULT 2 COMMENT '环境id'; + ADD COLUMN `environment_id` bigint unsigned NOT NULL DEFAULT 2 COMMENT '环境id'; ALTER TABLE `data_source` - modify COLUMN `user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; + modify COLUMN `user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; ALTER TABLE `data_source` ADD COLUMN `kind` varchar(32) NOT NULL DEFAULT 'PRIVATE' COMMENT '连接类型'; @@ -39,10 +39,10 @@ ALTER TABLE `dbhub_user` ADD `status` varchar(32) NOT NULL DEFAULT 'VALID' COMMENT '用户状态'; ALTER TABLE `dbhub_user` - ADD `create_user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '创建人用户id'; + ADD `create_user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '创建人用户id'; ALTER TABLE `dbhub_user` - ADD `modified_user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '修改人用户id'; + ADD `modified_user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '修改人用户id'; update dbhub_user set role_code= 'DESKTOP',user_name='_desktop_default_user_name',password='_desktop_default_user_name',nick_name='Desktop User' @@ -54,12 +54,12 @@ create UNIQUE INDEX uk_user_user_name on dbhub_user (user_name); CREATE TABLE IF NOT EXISTS `team` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `create_user_id` bigint(20) unsigned NOT NULL COMMENT '创建人用户id', - `modified_user_id` bigint(20) unsigned NOT NULL COMMENT '修改人用户id', - `code` varchar(128) DEFAULT NOT NULL COMMENT '团队编码', + `create_user_id` bigint unsigned NOT NULL COMMENT '创建人用户id', + `modified_user_id` bigint unsigned NOT NULL COMMENT '修改人用户id', + `code` varchar(128) NOT NULL DEFAULT '' COMMENT '团队编码', `name` varchar(512) DEFAULT NULL COMMENT '团队名称', `status` varchar(32) NOT NULL DEFAULT 'VALID' COMMENT '团队状态', `description` text DEFAULT NULL COMMENT '团队描述', @@ -73,13 +73,13 @@ create UNIQUE INDEX uk_team_code on team (code); CREATE TABLE IF NOT EXISTS `team_user` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `create_user_id` bigint(20) unsigned NOT NULL COMMENT '创建人用户id', - `modified_user_id` bigint(20) unsigned NOT NULL COMMENT '修改人用户id', - `team_id` bigint(20) unsigned NOT NULL COMMENT '团队id', - `user_id` bigint(20) unsigned NOT NULL COMMENT '用户id', + `create_user_id` bigint unsigned NOT NULL COMMENT '创建人用户id', + `modified_user_id` bigint unsigned NOT NULL COMMENT '修改人用户id', + `team_id` bigint unsigned NOT NULL COMMENT '团队id', + `user_id` bigint unsigned NOT NULL COMMENT '用户id', PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='用户团队表' @@ -91,14 +91,14 @@ create UNIQUE INDEX uk_team_user on team_user (`team_id`,`user_id`); CREATE TABLE IF NOT EXISTS `data_source_access` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `create_user_id` bigint(20) unsigned NOT NULL COMMENT '创建人用户id', - `modified_user_id` bigint(20) unsigned NOT NULL COMMENT '修改人用户id', - `data_source_id` bigint(20) unsigned NOT NULL COMMENT '数据源id', + `create_user_id` bigint unsigned NOT NULL COMMENT '创建人用户id', + `modified_user_id` bigint unsigned NOT NULL COMMENT '修改人用户id', + `data_source_id` bigint unsigned NOT NULL COMMENT '数据源id', `access_object_type` varchar(32) NOT NULL COMMENT '授权类型', - `access_object_id` bigint(20) unsigned NOT NULL COMMENT '授权id,根据类型区分是用户还是团队', + `access_object_id` bigint unsigned NOT NULL COMMENT '授权id,根据类型区分是用户还是团队', PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='数据源授权' @@ -109,25 +109,25 @@ create INDEX idx_data_source_access_access_object_id on data_source_access (`acc create UNIQUE INDEX uk_data_source_access on data_source_access (`data_source_id`,`access_object_type`, `access_object_id`); ALTER TABLE `operation_saved` - modify COLUMN `user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; + modify COLUMN `user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; update operation_saved set user_id= 1; ALTER TABLE `operation_log` - modify COLUMN `user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; + modify COLUMN `user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; update operation_log set user_id= 1; ALTER TABLE `dashboard` - modify `user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; + modify `user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; update dashboard set user_id= 1; ALTER TABLE `chart` - modify `user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; + modify `user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; update chart set user_id= 1; diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_1__TableCache.sql b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_1__TableCache.sql index 0c7cf3382..42c3c8213 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_1__TableCache.sql +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_1__TableCache.sql @@ -1,13 +1,13 @@ CREATE TABLE IF NOT EXISTS `table_cache_version` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `data_source_id` bigint(20) unsigned NOT NULL COMMENT '数据源连接ID', + `data_source_id` bigint unsigned NOT NULL COMMENT '数据源连接ID', `database_name` varchar(256) DEFAULT NULL COMMENT 'db名称', `schema_name` varchar(256) DEFAULT NULL COMMENT 'schema名称', `key` varchar(256) DEFAULT NULL COMMENT '唯一索引', - `version` bigint(20) unsigned NOT NULL COMMENT '版本', - `table_count` bigint(20) unsigned NOT NULL COMMENT '表数量', + `version` bigint unsigned NOT NULL COMMENT '版本', + `table_count` bigint unsigned NOT NULL COMMENT '表数量', `status` varchar(256) DEFAULT NULL COMMENT '状态', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='table cache version' @@ -16,15 +16,15 @@ create INDEX idx_table_cache_version_data_source_id on table_cache_version(`data create UNIQUE INDEX uk_table_cache_version_key on table_cache_version(`key`) ; CREATE TABLE IF NOT EXISTS `table_cache` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `data_source_id` bigint(20) unsigned NOT NULL COMMENT '数据源连接ID', + `data_source_id` bigint unsigned NOT NULL COMMENT '数据源连接ID', `database_name` varchar(256) DEFAULT NULL COMMENT 'db名称', `schema_name` varchar(256) DEFAULT NULL COMMENT 'schema名称', `table_name` varchar(256) DEFAULT NULL COMMENT 'table名称', `key` varchar(256) DEFAULT NULL COMMENT '唯一索引', - `version` bigint(20) unsigned NOT NULL COMMENT '版本', + `version` bigint unsigned NOT NULL COMMENT '版本', `columns` varchar(2048) DEFAULT NULL COMMENT '表字段', `extend_info` varchar(2048) NULL COMMENT '自定义扩展字段json', PRIMARY KEY (`id`) diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_2__OPERATION.sql b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_2__OPERATION.sql index b03031267..07d00471d 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_2__OPERATION.sql +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_2__OPERATION.sql @@ -1,8 +1,8 @@ ALTER TABLE `operation_log` ADD COLUMN `status` varchar(20) DEFAULT 'success' COMMENT '状态'; ALTER TABLE `operation_log` - ADD COLUMN `operation_rows` bigint(20) unsigned COMMENT '操作行数'; + ADD COLUMN `operation_rows` bigint unsigned COMMENT '操作行数'; ALTER TABLE `operation_log` - ADD COLUMN `use_time` bigint(20) unsigned COMMENT '使用时长'; + ADD COLUMN `use_time` bigint unsigned COMMENT '使用时长'; ALTER TABLE `operation_log` ADD COLUMN `extend_info` varchar(1024) COMMENT '扩展信息'; \ No newline at end of file diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_5__TableVector.sql b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_5__TableVector.sql index ec61f5764..89cd78f72 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_5__TableVector.sql +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_5__TableVector.sql @@ -1,7 +1,7 @@ CREATE TABLE IF NOT EXISTS `table_vector_mapping` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `api_key` varchar(128) DEFAULT NULL COMMENT 'api key', - `data_source_id` bigint(20) unsigned DEFAULT NULL COMMENT '数据源连接ID', + `data_source_id` bigint unsigned DEFAULT NULL COMMENT '数据源连接ID', `database` text DEFAULT NULL COMMENT '数据库名称', `schema` text DEFAULT NULL COMMENT 'schema名称', `status` varchar(4) DEFAULT NULL COMMENT '向量保存状态', diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_6__TableVectorUpdate.sql b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_6__TableVectorUpdate.sql index 196581ad9..4e4688436 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_6__TableVectorUpdate.sql +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_6__TableVectorUpdate.sql @@ -1 +1 @@ -ALTER TABLE table_vector_mapping ALTER COLUMN status VARCHAR(64); +ALTER TABLE table_vector_mapping MODIFY COLUMN status VARCHAR(64); diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_9__task.sql b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_9__task.sql index 326972a20..d449c593c 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_9__task.sql +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_9__task.sql @@ -1,13 +1,13 @@ CREATE TABLE IF NOT EXISTS `task` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', - `data_source_id` bigint(20) unsigned NULL COMMENT '数据源连接ID', + `data_source_id` bigint unsigned NULL COMMENT '数据源连接ID', `database_name` varchar(128) DEFAULT NULL COMMENT 'db名称', `schema_name` varchar(128) DEFAULT NULL COMMENT 'schema名称', `table_name` varchar(128) DEFAULT NULL COMMENT 'table_name', `deleted` varchar(10) DEFAULT NULL COMMENT '是否被删除,y表示删除,n表示未删除', - `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户id', + `user_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '用户id', `task_type` varchar(128) DEFAULT NULL COMMENT 'task type, such as: DOWNLOAD_DATA, UPLOAD_TABLE_DATA, DOWNLOAD_TABLE_STRUCTURE, UPLOAD_TABLE_STRUCTURE,', `task_status` varchar(128) DEFAULT NULL COMMENT 'task status', `task_progress` varchar(128) DEFAULT NULL COMMENT 'task progress', diff --git "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/temp/V2_1_0__\350\241\245\345\205\205.sql" "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/temp/V2_1_0__\350\241\245\345\205\205.sql" index 8aeedb33b..88599ddaf 100644 --- "a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/temp/V2_1_0__\350\241\245\345\205\205.sql" +++ "b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/temp/V2_1_0__\350\241\245\345\205\205.sql" @@ -1,16 +1,16 @@ # ALTER TABLE `operation_saved` -# modify COLUMN `user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; +# modify COLUMN `user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; # # update operation_saved # set user_id= 1; # # ALTER TABLE `dashboard` -# modify `user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; +# modify `user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; # update dashboard # set user_id= 1; # # # ALTER TABLE `chart` -# modify `user_id` bigint(20) unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; +# modify `user_id` bigint unsigned NOT NULL DEFAULT 1 COMMENT '用户id'; # update chart # set user_id= 1;