From 10db211b3c4240a3c6bc5e2ac82dc131b7d14909 Mon Sep 17 00:00:00 2001 From: Inifield Date: Mon, 12 Jun 2017 17:34:12 +0200 Subject: [PATCH] Import pending sql --- .../2017_06_12_00.sql} | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) rename data/sql/updates/{pending_db_world/rev_1475503571577105756.sql => db_world/2017_06_12_00.sql} (71%) diff --git a/data/sql/updates/pending_db_world/rev_1475503571577105756.sql b/data/sql/updates/db_world/2017_06_12_00.sql similarity index 71% rename from data/sql/updates/pending_db_world/rev_1475503571577105756.sql rename to data/sql/updates/db_world/2017_06_12_00.sql index 297ed9c71..03fde3902 100644 --- a/data/sql/updates/pending_db_world/rev_1475503571577105756.sql +++ b/data/sql/updates/db_world/2017_06_12_00.sql @@ -1,3 +1,18 @@ +-- DB update 2017_05_28_00 -> 2017_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 = '2017_05_28_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_05_28_00 2017_06_12_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1475503571577105756'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world(`sql_rev`) VALUES ('1475503571577105756'); DELETE FROM command WHERE name IN ('character delete', 'character deleted list', 'character deleted restore', 'character deleted delete', 'character deleted old', 'character erase'); INSERT INTO command (name, security, help) VALUES @@ -6,3 +21,12 @@ INSERT INTO command (name, security, help) VALUES ('character deleted list', 3, 'Syntax: .character deleted list [#guid|$name]\r\n\r\nShows a list with all deleted characters.\r\nIf $name is supplied, only characters with that string in their name will be selected, if #guid is supplied, only the character with that GUID will be selected.'), ('character deleted old', 4, 'Syntax: .character deleted old [#keepDays]\r\n\r\nCompletely deletes all characters with deleted time longer #keepDays. If #keepDays not provided the used value from mangosd.conf option ''CharDelete.KeepDays''. If referenced config option disabled (use 0 value) then command can''t be used without #keepDays.'), ('character deleted restore', 3, 'Syntax: .character deleted restore #guid|$name [$newname] [#new account]\r\n\r\nRestores deleted characters.\r\nIf $name is supplied, only characters with that string in their name will be restored, if $guid is supplied, only the character with that GUID will be restored.\r\nIf $newname is set, the character will be restored with that name instead of the original one. If #newaccount is set, the character will be restored to specific account character list. This works only with one character!'); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`;