From 725da843e46ceebd8c911ffde8090cf90590e827 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 4 Dec 2021 19:00:32 +0000 Subject: [PATCH] chore(DB): import pending files Referenced commit(s): ac8762138aab8b67a4efa42c7591561a75be280a --- data/sql/updates/db_world/2021_12_04_03.sql | 42 +++++++++++++++++++ .../rev_1638624697731724160.sql | 16 ------- 2 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 data/sql/updates/db_world/2021_12_04_03.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1638624697731724160.sql diff --git a/data/sql/updates/db_world/2021_12_04_03.sql b/data/sql/updates/db_world/2021_12_04_03.sql new file mode 100644 index 000000000..8a2f98974 --- /dev/null +++ b/data/sql/updates/db_world/2021_12_04_03.sql @@ -0,0 +1,42 @@ +-- DB update 2021_12_04_02 -> 2021_12_04_03 +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 = '2021_12_04_02'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2021_12_04_02 2021_12_04_03 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1638624697731724160'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1638624697731724160'); + +-- groups Rage Talon Captains 137860 and 137861 with their formations +DELETE FROM `creature_formations` WHERE `leaderGUID` IN (137860, 137861); +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(137860, 137860, 0, 0, 3, 0, 0), +(137860, 137866, 0, 0, 3, 0, 0), +(137860, 137961, 0, 0, 3, 0, 0), +(137860, 137963, 0, 0, 3, 0, 0), +(137860, 137994, 0, 0, 3, 0, 0), +(137861, 137861, 0, 0, 3, 0, 0), +(137861, 137867, 0, 0, 3, 0, 0), +(137861, 137982, 0, 0, 3, 0, 0), +(137861, 137981, 0, 0, 3, 0, 0), +(137861, 137863, 0, 0, 3, 0, 0); + + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2021_12_04_03' WHERE sql_rev = '1638624697731724160'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1638624697731724160.sql b/data/sql/updates/pending_db_world/rev_1638624697731724160.sql deleted file mode 100644 index 9b13f017b..000000000 --- a/data/sql/updates/pending_db_world/rev_1638624697731724160.sql +++ /dev/null @@ -1,16 +0,0 @@ -INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1638624697731724160'); - --- groups Rage Talon Captains 137860 and 137861 with their formations -DELETE FROM `creature_formations` WHERE `leaderGUID` IN (137860, 137861); -INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES -(137860, 137860, 0, 0, 3, 0, 0), -(137860, 137866, 0, 0, 3, 0, 0), -(137860, 137961, 0, 0, 3, 0, 0), -(137860, 137963, 0, 0, 3, 0, 0), -(137860, 137994, 0, 0, 3, 0, 0), -(137861, 137861, 0, 0, 3, 0, 0), -(137861, 137867, 0, 0, 3, 0, 0), -(137861, 137982, 0, 0, 3, 0, 0), -(137861, 137981, 0, 0, 3, 0, 0), -(137861, 137863, 0, 0, 3, 0, 0); -