diff --git a/support-files/sql/1001_ci_store_ddl_mysql.sql b/support-files/sql/1001_ci_store_ddl_mysql.sql index 3052979d14a..cab6900e934 100644 --- a/support-files/sql/1001_ci_store_ddl_mysql.sql +++ b/support-files/sql/1001_ci_store_ddl_mysql.sql @@ -61,7 +61,7 @@ CREATE TABLE IF NOT EXISTS `T_ATOM` ( `SUMMARY` varchar(256) DEFAULT NULL COMMENT '简介', `DESCRIPTION` text COMMENT '描述', `CATEGROY` tinyint(4) NOT NULL DEFAULT '1' COMMENT '类别', - `VERSION` varchar(20) NOT NULL COMMENT '版本号', + `VERSION` varchar(30) NOT NULL COMMENT '版本号', `LOGO_URL` varchar(256) DEFAULT NULL COMMENT 'LOGO URL地址', `ICON` text COMMENT '插件图标', `DEFAULT_FLAG` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否为默认原子', 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 new file mode 100644 index 00000000000..60f93e020b5 --- /dev/null +++ b/support-files/sql/2003_v2.x/2020_ci_store-update_v2.0_mysql.sql @@ -0,0 +1,27 @@ +USE devops_ci_store; +SET NAMES utf8mb4; + +DROP PROCEDURE IF EXISTS ci_store_schema_update; + +DELIMITER + +CREATE PROCEDURE ci_store_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_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 '版本号'; + END IF; + + COMMIT; +END +DELIMITER ; +COMMIT; +CALL ci_store_schema_update();