fix(接口测试): flyway

--user=郭雨琦
This commit is contained in:
guoyuqi 2022-04-06 19:37:38 +08:00 committed by xiaomeinvG
parent c874a054ae
commit 05a8fc5695
1 changed files with 15 additions and 0 deletions

View File

@ -1,2 +1,17 @@
ALTER TABLE test_plan
MODIFY name VARCHAR(128) NOT NULL COMMENT 'Plan name';
DROP PROCEDURE IF EXISTS schema_change_api;
DELIMITER //
CREATE PROCEDURE schema_change_api() BEGIN
DECLARE CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;
IF NOT EXISTS (SELECT * FROM information_schema.statistics WHERE table_schema=CurrentDatabase AND table_name = 'test_plan_test_case' AND index_name = 'plan_id_index') THEN
ALTER TABLE `test_plan_test_case` ADD INDEX plan_id_index ( `plan_id` );
END IF;
END//
DELIMITER ;
CALL schema_change_api();