From 26ac1816d0ff89a8c061dc114a14dc4c96c9a14e Mon Sep 17 00:00:00 2001 From: Kargatum Date: Sun, 7 Nov 2021 02:12:57 +0700 Subject: [PATCH] fix(Core/DB-Updater): correct world DB update (#9009) --- data/sql/updates/db_world/2021_11_06_00.sql | 27 +++++++++++++++++++++ data/sql/updates/db_world/2021_11_06_01.sql | 3 ++- data/sql/updates/db_world/2021_11_06_02.sql | 4 +-- data/sql/updates/db_world/2021_11_06_03.sql | 2 +- data/sql/updates/db_world/2021_11_06_04.sql | 1 + data/sql/updates/db_world/2021_11_06_05.sql | 2 +- data/sql/updates/db_world/2021_11_06_06.sql | 3 ++- 7 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 data/sql/updates/db_world/2021_11_06_00.sql diff --git a/data/sql/updates/db_world/2021_11_06_00.sql b/data/sql/updates/db_world/2021_11_06_00.sql new file mode 100644 index 000000000..aa590813c --- /dev/null +++ b/data/sql/updates/db_world/2021_11_06_00.sql @@ -0,0 +1,27 @@ +-- DB update 2021_11_05_12 -> 2021_11_06_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_11_05_12'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2021_11_05_12 2021_11_06_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1636218261558574700'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1636218261558574700'); + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2021_11_06_00' WHERE sql_rev = '1636218261558574700'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2021_11_06_01.sql b/data/sql/updates/db_world/2021_11_06_01.sql index f8532976f..2edb74eb5 100644 --- a/data/sql/updates/db_world/2021_11_06_01.sql +++ b/data/sql/updates/db_world/2021_11_06_01.sql @@ -17,7 +17,7 @@ SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '163605041442388901 INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1636050414423889017'); -- Condition for Wind Stone Gossip menu option -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (6540,6542,6543) AND `SourceEntry` IN (0,1,2,3,4) AND `SourceId`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup` IN (6540,6542,6543) AND `SourceEntry` IN (0,1,2,3,4) AND `SourceId`=0; INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES (15, 6540, 0, 0, 0, 1, 0, 24746, 0, 0, 0, 0, 0, '', 'Show gossip menu 6540 option id 0 if target has aura Twilight Cultist Disguise (effect 0).'), (15, 6540, 1, 0, 0, 1, 0, 24746, 0, 0, 0, 0, 0, '', 'Show gossip menu 6540 option id 1 if target has aura Twilight Cultist Disguise (effect 0).'), @@ -62,6 +62,7 @@ INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry (15, 6543, 4, 0, 0, 1, 0, 24782, 0, 0, 0, 0, 0, '', 'Show gossip menu 6543 option id 4 if target has aura Twilight Cultist Disguise (effect 0).'), (15, 6543, 4, 0, 0, 2, 0, 20448, 1, 0, 0, 0, 0, '', 'Show gossip menu 6543 option id 4 if player has 1 of Scepter of Beckoning: Thunder. Item cannot be in bank.'); + -- -- END UPDATING QUERIES -- diff --git a/data/sql/updates/db_world/2021_11_06_02.sql b/data/sql/updates/db_world/2021_11_06_02.sql index 2512ace38..5327472a7 100644 --- a/data/sql/updates/db_world/2021_11_06_02.sql +++ b/data/sql/updates/db_world/2021_11_06_02.sql @@ -16,12 +16,12 @@ SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '163570007622291300 INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1635700076222913000'); --- remove sneak from iron guard +-- Remove sneak from iron guard DELETE FROM `creature_addon` WHERE `guid` = 137990; INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `isLarge`, `auras`) VALUES (137990, 1379900, 0, 0, 1, 0, 0, ''); --- remove "remove sneak" from assassin, this way they drop the sneak on attacking +-- Remove "remove sneak" from assassin, this way they drop the sneak on attacking UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 10318; DELETE FROM `smart_scripts` WHERE `entryorguid` = 10318 AND `source_type` = 0 AND `id` = 1; diff --git a/data/sql/updates/db_world/2021_11_06_03.sql b/data/sql/updates/db_world/2021_11_06_03.sql index 4dd85f5c1..d8bf07e82 100644 --- a/data/sql/updates/db_world/2021_11_06_03.sql +++ b/data/sql/updates/db_world/2021_11_06_03.sql @@ -18,7 +18,7 @@ INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1635944366683482486'); -- Add missing weapons to Gordunni npcs DELETE FROM `creature_equip_template` WHERE `CreatureID` IN (5239,5234,5236,5240); -INSERT INTO `creature_equip_template` (`CreatureID`,`ID`,`ItemID1`,`ItemID2`,`ItemID3`,`VerifiedBuild`) VALUES +INSERT INTO `creature_equip_template` (`CreatureID`, `ID`, `ItemID1`, `ItemID2`, `ItemID3`, `VerifiedBuild`) VALUES (5239,1,5304,0,0,0), (5234,1,1903,2809,0,0), (5236,1,1907,0,0,0), diff --git a/data/sql/updates/db_world/2021_11_06_04.sql b/data/sql/updates/db_world/2021_11_06_04.sql index d59028e19..e7b100db4 100644 --- a/data/sql/updates/db_world/2021_11_06_04.sql +++ b/data/sql/updates/db_world/2021_11_06_04.sql @@ -16,6 +16,7 @@ SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '163595118786692386 -- add revision INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1635951187866923861'); + -- add orientation` and delay into existing wp table ALTER TABLE `waypoints` ADD COLUMN `orientation` FLOAT DEFAULT 0 NOT NULL AFTER `position_z`, ADD COLUMN `delay` INT UNSIGNED DEFAULT 0 NOT NULL AFTER `orientation`; diff --git a/data/sql/updates/db_world/2021_11_06_05.sql b/data/sql/updates/db_world/2021_11_06_05.sql index 6b19c3dbc..f5c417fc4 100644 --- a/data/sql/updates/db_world/2021_11_06_05.sql +++ b/data/sql/updates/db_world/2021_11_06_05.sql @@ -17,7 +17,7 @@ SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '163620618767619340 INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1636206187676193400'); -- Fix equipment for Southsea Swashbuckler -UPDATE `creature_equip_template` SET `ItemID1`=1897, `ItemID2`=0 WHERE `CreatureID`=7858; +UPDATE `creature_equip_template` SET `ItemID1`= 1897, `ItemID2`=0 WHERE `CreatureID`=7858; -- -- END UPDATING QUERIES diff --git a/data/sql/updates/db_world/2021_11_06_06.sql b/data/sql/updates/db_world/2021_11_06_06.sql index cd62b94ff..316d44f97 100644 --- a/data/sql/updates/db_world/2021_11_06_06.sql +++ b/data/sql/updates/db_world/2021_11_06_06.sql @@ -16,7 +16,8 @@ SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '163620694354037610 INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1636206943540376100'); -ALTER TABLE `updates` CHANGE `state` `state` ENUM('RELEASED','CUSTOM','MODULE','ARCHIVED') CHARSET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'RELEASED' NOT NULL COMMENT 'defines if an update is released or archived.'; +ALTER TABLE `updates` + CHANGE `state` `state` ENUM('RELEASED','CUSTOM','MODULE','ARCHIVED') CHARSET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'RELEASED' NOT NULL COMMENT 'defines if an update is released or archived.'; -- -- END UPDATING QUERIES