From aea542766b2853161391d771b04ecee8f555e388 Mon Sep 17 00:00:00 2001 From: yjieliang Date: Wed, 18 Oct 2023 18:40:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=B8=8C=E6=9C=9B=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=88=86=E6=94=AF=E8=BF=9B=E8=A1=8C=E4=B8=8A=E6=9E=B6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20#4780?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- support-files/sql/1001_ci_store_ddl_mysql.sql | 2 +- .../2020_ci_store-update_v2.0_mysql.sql | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 support-files/sql/2003_v2.x/2020_ci_store-update_v2.0_mysql.sql 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();