-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
support-files/sql/2003_v2.x/2020_ci_store-update_v2.0_mysql.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
USE devops_ci_store; | ||
SET NAMES utf8mb4; | ||
|
||
DROP PROCEDURE IF EXISTS ci_store_schema_update; | ||
|
||
DELIMITER <CI_UBF> | ||
|
||
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 <CI_UBF> | ||
DELIMITER ; | ||
COMMIT; | ||
CALL ci_store_schema_update(); |