From 0c3536979a2471b279a3cb3910225fdbe74fa4fb Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 13 Jan 2022 10:48:04 +0000 Subject: [PATCH] chore(DB): import pending files Referenced commit(s): df4b621527ed905e4c7007d7c94741cc23f45280 --- .../2022_01_13_00.sql} | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) rename data/sql/updates/{pending_db_world/rev_1642054240860129732.sql => db_world/2022_01_13_00.sql} (73%) diff --git a/data/sql/updates/pending_db_world/rev_1642054240860129732.sql b/data/sql/updates/db_world/2022_01_13_00.sql similarity index 73% rename from data/sql/updates/pending_db_world/rev_1642054240860129732.sql rename to data/sql/updates/db_world/2022_01_13_00.sql index bfa74531e..9d6847b86 100644 --- a/data/sql/updates/pending_db_world/rev_1642054240860129732.sql +++ b/data/sql/updates/db_world/2022_01_13_00.sql @@ -1,3 +1,19 @@ +-- DB update 2022_01_12_05 -> 2022_01_13_00 +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 = '2022_01_12_05'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2022_01_12_05 2022_01_13_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1642054240860129732'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1642054240860129732'); UPDATE `smart_scripts` SET `target_type`=0 WHERE `action_type`=25; @@ -20,3 +36,13 @@ UPDATE `smart_scripts` SET `target_type`=0 WHERE `entryorguid` IN(33519, 30081, UPDATE `smart_scripts` SET `target_type`=0 WHERE `entryorguid`=37158 AND `action_type`=34; UPDATE `smart_scripts` SET `target_type`=0 WHERE `entryorguid` IN(11350, 11352, 11355, 11359); UPDATE `smart_scripts` SET `target_type`=0 WHERE `entryorguid` IN(29861, 30475, 30829, 30830, 30838, 30839, 30840, 32357, 32400, 33306, 33382, 33383, 33384, 33519, 33558, 33559, 33561, 33562, 33564, 27220, 27238, 21926) AND `action_type`=11; + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2022_01_13_00' WHERE sql_rev = '1642054240860129732'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`;