diff --git a/data/sql/updates/pending_db_world/rev_1525370516654001760.sql b/data/sql/updates/db_world/2018_05_13_00.sql similarity index 57% rename from data/sql/updates/pending_db_world/rev_1525370516654001760.sql rename to data/sql/updates/db_world/2018_05_13_00.sql index 2b0d8e7b0..95a75486b 100644 --- a/data/sql/updates/pending_db_world/rev_1525370516654001760.sql +++ b/data/sql/updates/db_world/2018_05_13_00.sql @@ -1,3 +1,19 @@ +-- DB update 2018_05_07_00 -> 2018_05_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 = '2018_05_07_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2018_05_07_00 2018_05_13_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1525370516654001760'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + INSERT INTO version_db_world (`sql_rev`) VALUES ('1525370516654001760'); UPDATE `smart_scripts` SET `link` = 3, `target_type` = 21, `target_param1` = 30, `action_param2` = 5000 WHERE `entryorguid` = 2044 AND `id` = 0; @@ -17,3 +33,12 @@ VALUES 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 30, 0, 0, 0, 0, 0, 0, 'Forlorn Spirit - On Text Over - Start Attacking'); + +-- +-- END UPDATING QUERIES +-- +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`;