From b3d131bba96c2bab1c93b86b6df2f0ea0892a342 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 25 Nov 2021 15:26:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20flyway=E5=A4=84=E7=90=86=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V99__v1.15_release.sql | 34 ++----------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/backend/src/main/resources/db/migration/V99__v1.15_release.sql b/backend/src/main/resources/db/migration/V99__v1.15_release.sql index 67924fc8ae..5f54a9f3cb 100644 --- a/backend/src/main/resources/db/migration/V99__v1.15_release.sql +++ b/backend/src/main/resources/db/migration/V99__v1.15_release.sql @@ -33,37 +33,9 @@ alter table api_scenario alter table api_scenario add environment_group_id varchar(50) null; -DELIMITER $$ -DROP PROCEDURE IF EXISTS proc_loop_test$$ -CREATE PROCEDURE proc_loop_test() -BEGIN - DECLARE int_val INT DEFAULT 0; - DECLARE size INT DEFAULT 10; - DECLARE count_scenario INT DEFAULT 0; - SELECT COUNT(1) INTO count_scenario FROM api_scenario; - test_loop : - LOOP - IF (int_val > count_scenario / size) - THEN - UPDATE api_scenario - SET environment_json = api_scenario.scenario_definition -> '$.environmentMap' - WHERE api_scenario.id IN (SELECT id FROM (SELECT id FROM api_scenario LIMIT int_val, size) l); - # - LEAVE test_loop; - END IF; - - UPDATE api_scenario - SET environment_json = api_scenario.scenario_definition -> '$.environmentMap' - WHERE api_scenario.id IN (SELECT id FROM (SELECT id FROM api_scenario LIMIT int_val, size) l); - - SET int_val = int_val + size; - END LOOP; -END$$ - -DELIMITER ; -CALL proc_loop_test(); -DROP PROCEDURE proc_loop_test; - +update api_scenario +set environment_json = api_scenario.scenario_definition -> '$.environmentMap' +where api_scenario.environment_json is null; update api_scenario set environment_type = 'JSON';