Core/DB: Unify creature_respawn and gameobject_respawn into a single respawn table

(cherry picked from commit 374597c8e9)
This commit is contained in:
Treeston
2019-07-14 18:49:38 +02:00
committed by Shauren
parent 58fb2ef631
commit be05590a12
7 changed files with 81 additions and 126 deletions

View File

@@ -0,0 +1,20 @@
--
DROP TABLE IF EXISTS `respawn`;
CREATE TABLE `respawn` (
`type` smallint(10) unsigned NOT NULL,
`spawnId` bigint(20) unsigned NOT NULL,
`respawnTime` bigint(20) NOT NULL,
`mapId` smallint(10) unsigned NOT NULL,
`instanceId` int(10) unsigned NOT NULL,
PRIMARY KEY (`type`,`spawnId`,`instanceId`),
KEY `idx_instance` (`instanceId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stored respawn times';
INSERT INTO `respawn` (`type`,`spawnId`,`respawnTime`,`mapId`,`instanceId`)
SELECT 0 as `type`,`guid`,`respawnTime`,`mapId`,`instanceId` FROM `creature_respawn`;
INSERT INTO `respawn` (`type`,`spawnId`,`respawnTime`,`mapId`,`instanceId`)
SELECT 1 as `type`,`guid`,`respawnTime`,`mapId`,`instanceId` FROM `gameobject_respawn`;
DROP TABLE `creature_respawn`;
DROP TABLE `gameobject_respawn`;