mirror of https://github.com/apache/cloudstack.git
renamed created_exists to created_column_not_exists in sql migration script
This commit is contained in:
parent
a15fe4f1f4
commit
cf8dd76d4c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue