diff --git a/support-files/sql/1001_ci_process_ddl_mysql.sql b/support-files/sql/1001_ci_process_ddl_mysql.sql index 9124b4450ec..85ddf1c63ba 100644 --- a/support-files/sql/1001_ci_process_ddl_mysql.sql +++ b/support-files/sql/1001_ci_process_ddl_mysql.sql @@ -363,7 +363,7 @@ CREATE TABLE IF NOT EXISTS `T_PIPELINE_MODEL_TASK` ( `OS` varchar(45) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '操作系统', `ADDITIONAL_OPTIONS` mediumtext CHARACTER SET utf8mb4 COMMENT '其他选项', `ATOM_CODE` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '插件的唯一标识', - `ATOM_VERSION` varchar(20) COMMENT '插件版本号', + `ATOM_VERSION` varchar(30) COMMENT '插件版本号', `CREATE_TIME` datetime(3) COMMENT '创建时间', `UPDATE_TIME` datetime(3) COMMENT '更新时间', PRIMARY KEY (`PIPELINE_ID`,`PROJECT_ID`,`STAGE_ID`,`CONTAINER_ID`,`TASK_ID`), diff --git a/support-files/sql/1001_ci_quality_ddl_mysql.sql b/support-files/sql/1001_ci_quality_ddl_mysql.sql index 05d0103a1ae..2eb30ce97a0 100644 --- a/support-files/sql/1001_ci_quality_ddl_mysql.sql +++ b/support-files/sql/1001_ci_quality_ddl_mysql.sql @@ -183,7 +183,7 @@ CREATE TABLE IF NOT EXISTS `T_QUALITY_CONTROL_POINT` `UPDATE_USER` varchar(64) DEFAULT NULL COMMENT '更新用户', `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间', `UPDATE_TIME` datetime DEFAULT NULL COMMENT '更新时间', - `ATOM_VERSION` varchar(16) DEFAULT '1.0.0' COMMENT '插件版本', + `ATOM_VERSION` varchar(30) DEFAULT '1.0.0' COMMENT '插件版本', `TEST_PROJECT` varchar(64) NOT NULL DEFAULT '' COMMENT '测试的项目', `CONTROL_POINT_HASH_ID` varchar(64) DEFAULT NULL COMMENT '哈希ID', `TAG` VARCHAR(64) NULL, @@ -261,7 +261,7 @@ CREATE TABLE IF NOT EXISTS `T_QUALITY_INDICATOR` `UPDATE_USER` varchar(64) DEFAULT NULL COMMENT '更新用户', `CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间', `UPDATE_TIME` datetime DEFAULT NULL COMMENT '更新时间', - `ATOM_VERSION` varchar(16) NOT NULL DEFAULT '1.0.0' COMMENT '插件版本号', + `ATOM_VERSION` varchar(30) NOT NULL DEFAULT '1.0.0' COMMENT '插件版本号', `LOG_PROMPT` varchar(1024) NOT NULL DEFAULT '' COMMENT '日志提示', PRIMARY KEY (`ID`) ) ENGINE = InnoDB diff --git a/support-files/sql/2003_v2.x/2020_ci_process-update_v2.0_mysql.sql b/support-files/sql/2003_v2.x/2020_ci_process-update_v2.0_mysql.sql index 7119a8d49e8..2a0a3facc0f 100644 --- a/support-files/sql/2003_v2.x/2020_ci_process-update_v2.0_mysql.sql +++ b/support-files/sql/2003_v2.x/2020_ci_process-update_v2.0_mysql.sql @@ -85,6 +85,14 @@ BEGIN ADD INDEX `IDX_TPVUS_PROJECT_ID`(`PROJECT_ID`); END IF; + IF EXISTS(SELECT 1 + FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = db + AND TABLE_NAME = 'T_PIPELINE_MODEL_TASK' + AND COLUMN_NAME = 'ATOM_VERSION') THEN + ALTER TABLE T_PIPELINE_MODEL_TASK MODIFY COLUMN ATOM_VERSION varchar(30) NULL; + END IF; + COMMIT; END DELIMITER ; diff --git a/support-files/sql/2003_v2.x/2020_ci_quality-update_v2.0_mysql.sql b/support-files/sql/2003_v2.x/2020_ci_quality-update_v2.0_mysql.sql new file mode 100644 index 00000000000..595c5157fb9 --- /dev/null +++ b/support-files/sql/2003_v2.x/2020_ci_quality-update_v2.0_mysql.sql @@ -0,0 +1,34 @@ +USE devops_ci_quality; +SET NAMES utf8mb4; + +DROP PROCEDURE IF EXISTS ci_quality_schema_update; + +DELIMITER + +CREATE PROCEDURE ci_quality_schema_update() +BEGIN + + DECLARE db VARCHAR(100); + SET AUTOCOMMIT = 0; + SELECT DATABASE() INTO db; + + IF EXISTS(SELECT 1 + FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = db + AND TABLE_NAME = 'T_QUALITY_CONTROL_POINT' + AND COLUMN_NAME = 'ATOM_VERSION') THEN + ALTER TABLE T_QUALITY_CONTROL_POINT MODIFY COLUMN ATOM_VERSION varchar(30) DEFAULT '1.0.0' NULL; + END IF; + IF EXISTS(SELECT 1 + FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = db + AND TABLE_NAME = 'T_QUALITY_INDICATOR' + AND COLUMN_NAME = 'ATOM_VERSION') THEN + ALTER TABLE T_QUALITY_INDICATOR MODIFY COLUMN ATOM_VERSION varchar(30) DEFAULT '1.0.0' NOT NULL; + END IF; + + COMMIT; +END +DELIMITER ; +COMMIT; +CALL ci_quality_schema_update(); diff --git a/support-files/sql/2003_v2.x/2020_ci_store-update_v2.0_mysql.sql b/support-files/sql/2003_v2.x/2020_ci_store-update_v2.0_mysql.sql index 60f93e020b5..2c3260b1517 100644 --- a/support-files/sql/2003_v2.x/2020_ci_store-update_v2.0_mysql.sql +++ b/support-files/sql/2003_v2.x/2020_ci_store-update_v2.0_mysql.sql @@ -17,7 +17,7 @@ BEGIN WHERE TABLE_SCHEMA = db AND TABLE_NAME = 'T_ATOM' AND COLUMN_NAME = 'VERSION') THEN - ALTER TABLE T_ATOM MODIFY COLUMN VERSION varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '版本号'; + ALTER TABLE T_ATOM MODIFY COLUMN VERSION varchar(30) NOT NULL; END IF; COMMIT;