Skip to content

Commit

Permalink
feat:希望支持分支进行上架测试 #4780
Browse files Browse the repository at this point in the history
  • Loading branch information
yjieliang committed Oct 23, 2023
1 parent 5123d85 commit 06789ee
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
2 changes: 1 addition & 1 deletion support-files/sql/1001_ci_process_ddl_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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`),
Expand Down
4 changes: 2 additions & 2 deletions support-files/sql/1001_ci_quality_ddl_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <CI_UBF>
DELIMITER ;
Expand Down
34 changes: 34 additions & 0 deletions support-files/sql/2003_v2.x/2020_ci_quality-update_v2.0_mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
USE devops_ci_quality;
SET NAMES utf8mb4;

DROP PROCEDURE IF EXISTS ci_quality_schema_update;

DELIMITER <CI_UBF>

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 <CI_UBF>
DELIMITER ;
COMMIT;
CALL ci_quality_schema_update();
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 06789ee

Please sign in to comment.