From 9030c0cb47294ec544bfb48d4442528a73f394fb Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 22 Jul 2021 00:36:09 +0000 Subject: [PATCH] chore(DB): import pending files Referenced commit(s): 1cf7f5c8a00c5dfb8f19d26b98cb6d5b79076b08 --- data/sql/updates/db_world/2021_07_22_00.sql | 37 +++++++++++++++++++ .../rev_1626532264671526700.sql | 11 ------ 2 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 data/sql/updates/db_world/2021_07_22_00.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1626532264671526700.sql diff --git a/data/sql/updates/db_world/2021_07_22_00.sql b/data/sql/updates/db_world/2021_07_22_00.sql new file mode 100644 index 000000000..6fb47066a --- /dev/null +++ b/data/sql/updates/db_world/2021_07_22_00.sql @@ -0,0 +1,37 @@ +-- DB update 2021_07_21_02 -> 2021_07_22_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 = '2021_07_21_02'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2021_07_21_02 2021_07_22_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1626532264671526700'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1626532264671526700'); + +-- We had 2 gossips with the id, and it was choosing the wrong one. So we insert into a new one id. +DELETE FROM `gossip_menu` WHERE `menuid` = 61025 and `textid` = 10041; + +-- The line 10041 is the one needed for this character. +INSERT INTO `gossip_menu` (`menuid`, `textid` ) VALUES (61025 ,10041); + +-- We update the character to use the new gossip id. +UPDATE `creature_template` SET `gossip_menu_id` = 61025, `faction` = 1604 WHERE (`entry` = 20406); + + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2021_07_22_00' WHERE sql_rev = '1626532264671526700'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1626532264671526700.sql b/data/sql/updates/pending_db_world/rev_1626532264671526700.sql deleted file mode 100644 index c1e7952af..000000000 --- a/data/sql/updates/pending_db_world/rev_1626532264671526700.sql +++ /dev/null @@ -1,11 +0,0 @@ -INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1626532264671526700'); - --- We had 2 gossips with the id, and it was choosing the wrong one. So we insert into a new one id. -DELETE FROM `gossip_menu` WHERE `menuid` = 61025 and `textid` = 10041; - --- The line 10041 is the one needed for this character. -INSERT INTO `gossip_menu` (`menuid`, `textid` ) VALUES (61025 ,10041); - --- We update the character to use the new gossip id. -UPDATE `creature_template` SET `gossip_menu_id` = 61025, `faction` = 1604 WHERE (`entry` = 20406); -