Skip to content

Commit

Permalink
chore(DB): import pending files
Browse files Browse the repository at this point in the history
Referenced commit(s): f5d01ba
  • Loading branch information
AzerothCoreBot committed Mar 27, 2022
1 parent f5d01ba commit c9d2c5a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
34 changes: 34 additions & 0 deletions data/sql/updates/db_world/2022_03_27_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- DB update 2022_03_27_00 -> 2022_03_27_01
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_27_00';
IF @COLEXISTS = 0 THEN LEAVE proc; END IF;
START TRANSACTION;
ALTER TABLE version_db_world CHANGE COLUMN 2022_03_27_00 2022_03_27_01 bit;
SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1647566741929769300'; IF OK <> 'FALSE' THEN LEAVE proc; END IF;
--
-- START UPDATING QUERIES
--

INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1647566741929769300');

SET @LEADERGUID := 84648;
DELETE FROM `creature_formations` WHERE `memberGUID` IN (@LEADERGUID, 84639, 84650);
INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`) VALUES
(@LEADERGUID, @LEADERGUID, 0, 0, 3),
(@LEADERGUID, 84639, 0, 0, 3),
(@LEADERGUID, 84650, 0, 0, 3);

--
-- END UPDATING QUERIES
--
UPDATE version_db_world SET date = '2022_03_27_01' WHERE sql_rev = '1647566741929769300';
COMMIT;
END //
DELIMITER ;
CALL updateDb();
DROP PROCEDURE IF EXISTS `updateDb`;
8 changes: 0 additions & 8 deletions data/sql/updates/pending_db_world/rev_1647566741929769300.sql

This file was deleted.

0 comments on commit c9d2c5a

Please sign in to comment.