diff --git a/engine/schema/src/main/resources/META-INF/db/schema-41811to41812.sql b/engine/schema/src/main/resources/META-INF/db/schema-41811to41812.sql index 4542f1b9084..62aafa640b6 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-41811to41812.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-41811to41812.sql @@ -23,17 +23,17 @@ -- adding one more time here in case if migration from 4.18.0 didn't go through CREATE PROCEDURE `cloud`.`ADD_RESOURCE_RESERVATION_MGMT_SERVER_ID_CREATED`() BEGIN - DECLARE created_exists TINYINT DEFAULT FALSE + DECLARE created_column_not_exists TINYINT DEFAULT FALSE ; IF NOT EXISTS (SELECT * FROM `information_schema`.`columns` WHERE `table_schema` = 'cloud' AND `table_name` = 'resource_reservation' AND `column_name` = 'mgmt_server_id') THEN CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.resource_reservation', 'mgmt_server_id', 'bigint unsigned NULL COMMENT "management server id" ') ; END IF ; IF NOT EXISTS (SELECT * FROM `information_schema`.`columns` WHERE `table_schema` = 'cloud' AND `table_name` = 'resource_reservation' AND `column_name` = 'created') THEN - SET created_exists = TRUE + SET created_column_not_exists = TRUE ; END IF -; IF created_exists THEN +; IF created_column_not_exists THEN CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.resource_reservation', 'created', 'datetime DEFAULT NULL COMMENT "date when the reservation was created" ') ; END IF -; IF created_exists THEN +; IF created_column_not_exists THEN UPDATE `cloud`.`resource_reservation` SET `created` = now() WHERE `created` IS NULL ; END IF ; END;