diff --git a/data/sql/updates/pending_db_world/rev_1554113581920680700.sql b/data/sql/updates/db_world/2019_04_07_00.sql similarity index 80% rename from data/sql/updates/pending_db_world/rev_1554113581920680700.sql rename to data/sql/updates/db_world/2019_04_07_00.sql index 5761ec1fa..5ba929be0 100644 --- a/data/sql/updates/pending_db_world/rev_1554113581920680700.sql +++ b/data/sql/updates/db_world/2019_04_07_00.sql @@ -1,3 +1,19 @@ +-- DB update 2019_04_06_01 -> 2019_04_07_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 = '2019_04_06_01'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2019_04_06_01 2019_04_07_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1554113581920680700'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1554113581920680700'); -- Field Marshal Afrasiabi SAI @@ -24,3 +40,12 @@ DELETE FROM `creature_text` WHERE `creatureid` IN (14721); INSERT INTO `creature_text` (`creatureid`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextId`) VALUES (14721, 0, 0, 'Citizens of the Alliance, the Lord of Blackrock is slain! Nefarian has been subdued by the combined might of $N and $Ghis:her; allies!', 14, 0, 100, 0, 0, 0, 'Field Marshal Afrasiabi', 9870), (14721, 1, 0, 'Let your spirits rise! Rally around your champion, bask in $Ghis:her; glory! Revel in the rallying cry of the dragon slayer!', 14, 0, 100, 0, 0, 0, 'Field Marshal Afrasiabi', 9872); + +-- +-- END UPDATING QUERIES +-- +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`;