diff --git a/data/sql/updates/pending_db_world/rev_1528731505867561398.sql b/data/sql/updates/db_world/2018_06_12_00.sql similarity index 76% rename from data/sql/updates/pending_db_world/rev_1528731505867561398.sql rename to data/sql/updates/db_world/2018_06_12_00.sql index 06b1b8716..1e56bcc60 100644 --- a/data/sql/updates/pending_db_world/rev_1528731505867561398.sql +++ b/data/sql/updates/db_world/2018_06_12_00.sql @@ -1,3 +1,19 @@ +-- DB update 2018_06_11_00 -> 2018_06_12_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_06_11_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2018_06_11_00 2018_06_12_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1528731505867561398'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + INSERT INTO version_db_world (`sql_rev`) VALUES ('1528731505867561398'); DELETE FROM `creature_text` WHERE `entry` = 28948; @@ -19,3 +35,12 @@ VALUES (28948,12,0,'Stay for as long as you like, $N. Glory in the fruits of your labor!',12,0,100,1,0,0,29438,0,'Malmortis text'), (28948,13,0,'Your service has been invaluable in fulfilling the master''s plan. May you forever grow in power....',12,0,100,1,0,0,29439,0,'Malmortis text'), (28948,14,0,'Farewell.',12,0,100,1,0,0,29440,0,'Malmortis text'); + +-- +-- END UPDATING QUERIES +-- +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`;