From 786a3c967aef4473e9a052ebebef7ec9ee309a73 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 16 Sep 2020 16:23:44 +0000 Subject: [PATCH] chore(DB): import pending SQL update file Referenced commit(s): 72b8ef3a12efa4c95a13d17f79be407d3b80f22d --- data/sql/updates/db_world/2020_09_16_02.sql | 30 +++++++++++++++++++ .../rev_1600168171923653600.sql | 5 ---- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 data/sql/updates/db_world/2020_09_16_02.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1600168171923653600.sql diff --git a/data/sql/updates/db_world/2020_09_16_02.sql b/data/sql/updates/db_world/2020_09_16_02.sql new file mode 100644 index 000000000..985c4377e --- /dev/null +++ b/data/sql/updates/db_world/2020_09_16_02.sql @@ -0,0 +1,30 @@ +-- DB update 2020_09_16_01 -> 2020_09_16_02 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2020_09_16_01'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2020_09_16_01 2020_09_16_02 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1600168171923653600'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1600168171923653600'); + +DELETE FROM `game_event` WHERE `eventEntry` = 24; +INSERT INTO `game_event` (`eventEntry`, `start_time`, `end_time`, `occurence`, `length`, `holiday`, `holidayStage`, `description`, `world_event`, `announce`) VALUES +(24, '2017-09-20 01:01:00', '2030-12-31 07:00:00', 525600, 21600, 372, 2, 'Brewfest', 0, 2); + +-- +-- END UPDATING QUERIES +-- +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1600168171923653600.sql b/data/sql/updates/pending_db_world/rev_1600168171923653600.sql deleted file mode 100644 index 2b7403824..000000000 --- a/data/sql/updates/pending_db_world/rev_1600168171923653600.sql +++ /dev/null @@ -1,5 +0,0 @@ -INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1600168171923653600'); - -DELETE FROM `game_event` WHERE `eventEntry` = 24; -INSERT INTO `game_event` (`eventEntry`, `start_time`, `end_time`, `occurence`, `length`, `holiday`, `holidayStage`, `description`, `world_event`, `announce`) VALUES -(24, '2017-09-20 01:01:00', '2030-12-31 07:00:00', 525600, 21600, 372, 2, 'Brewfest', 0, 2);