From f5f2e5bbf3b38a4deaa553a2ffb5ccba04f23688 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sun, 28 Jan 2018 14:09:50 +0000 Subject: [PATCH] Importing pending sql --- data/sql/updates/db_world/2018_01_28_00.sql | 38 +++++++++++++++++++ .../rev_1516149942175144200.sql | 13 ------- 2 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 data/sql/updates/db_world/2018_01_28_00.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1516149942175144200.sql diff --git a/data/sql/updates/db_world/2018_01_28_00.sql b/data/sql/updates/db_world/2018_01_28_00.sql new file mode 100644 index 000000000..265f5f42a --- /dev/null +++ b/data/sql/updates/db_world/2018_01_28_00.sql @@ -0,0 +1,38 @@ +-- DB update 2018_01_21_00 -> 2018_01_28_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 = '2018_01_21_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2018_01_21_00 2018_01_28_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1516149942175144200'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO version_db_world (`sql_rev`) VALUES ('1516149942175144200'); + +-- Useless loot +DELETE FROM `creature_loot_template` WHERE `entry` IN (1, 1175); +-- Conditions for lootid 1, useless +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 1 AND `SourceGroup` = 1; + +-- Attumen the Huntsman - Fix condition on item 23809 +UPDATE `conditions` SET `SourceGroup` = 16152 WHERE `SourceGroup` = 15550 AND `SourceEntry` = 23809; + +-- Conditions that aren't referenced and, still, aren't correct. +DELETE FROM `conditions` WHERE `SourceGroup` = 21060 AND `SourceEntry` = 23612; +DELETE FROM `conditions` WHERE `SourceGroup` = 21061 AND `SourceEntry` = 23612; + +-- +-- END UPDATING QUERIES +-- +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1516149942175144200.sql b/data/sql/updates/pending_db_world/rev_1516149942175144200.sql deleted file mode 100644 index 8032f4ba0..000000000 --- a/data/sql/updates/pending_db_world/rev_1516149942175144200.sql +++ /dev/null @@ -1,13 +0,0 @@ -INSERT INTO version_db_world (`sql_rev`) VALUES ('1516149942175144200'); - --- Useless loot -DELETE FROM `creature_loot_template` WHERE `entry` IN (1, 1175); --- Conditions for lootid 1, useless -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 1 AND `SourceGroup` = 1; - --- Attumen the Huntsman - Fix condition on item 23809 -UPDATE `conditions` SET `SourceGroup` = 16152 WHERE `SourceGroup` = 15550 AND `SourceEntry` = 23809; - --- Conditions that aren't referenced and, still, aren't correct. -DELETE FROM `conditions` WHERE `SourceGroup` = 21060 AND `SourceEntry` = 23612; -DELETE FROM `conditions` WHERE `SourceGroup` = 21061 AND `SourceEntry` = 23612;