From 73c5375469a0345e1b09e7a3d305f02b559617a6 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 21 Mar 2022 07:44:48 +0000 Subject: [PATCH] chore(DB): import pending files Referenced commit(s): 8358a5d68efd77b8c09294e7fbf4088d885fe93e --- data/sql/updates/db_world/2022_03_21_00.sql | 29 +++++++++++++++++++ .../rev_1647791446104793800.sql | 3 -- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 data/sql/updates/db_world/2022_03_21_00.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1647791446104793800.sql diff --git a/data/sql/updates/db_world/2022_03_21_00.sql b/data/sql/updates/db_world/2022_03_21_00.sql new file mode 100644 index 000000000..f1d2f5a03 --- /dev/null +++ b/data/sql/updates/db_world/2022_03_21_00.sql @@ -0,0 +1,29 @@ +-- DB update 2022_03_18_20 -> 2022_03_21_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 = '2022_03_18_20'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2022_03_18_20 2022_03_21_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1647791446104793800'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- + +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1647791446104793800'); + +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|512 WHERE `entry` IN (10184,36538); + +-- +-- END UPDATING QUERIES +-- +UPDATE version_db_world SET date = '2022_03_21_00' WHERE sql_rev = '1647791446104793800'; +COMMIT; +END // +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1647791446104793800.sql b/data/sql/updates/pending_db_world/rev_1647791446104793800.sql deleted file mode 100644 index 656920e26..000000000 --- a/data/sql/updates/pending_db_world/rev_1647791446104793800.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1647791446104793800'); - -UPDATE `creature_template` SET `flags_extra`=`flags_extra`|512 WHERE `entry` IN (10184,36538);