refactor(测试跟踪): flyway

--user=郭雨琦
场景报告结果表加索引
This commit is contained in:
guoyuqi 2022-04-13 17:56:17 +08:00 committed by 刘瑞斌
parent ddd7fa4587
commit 487c7b84fa
1 changed files with 11 additions and 0 deletions

View File

@ -29,3 +29,14 @@ CREATE INDEX custom_field_template_template_id_index
CREATE INDEX test_case_review_test_case_review_id_index CREATE INDEX test_case_review_test_case_review_id_index
ON test_case_review_test_case(review_id); ON test_case_review_test_case(review_id);
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 = 'api_scenario_report_result' AND index_name = 'report_id_index') THEN
ALTER TABLE `api_scenario_report_result` ADD INDEX report_id_index ( `report_id` );
END IF;
END//
DELIMITER ;
CALL schema_change_api();