mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 22:49:39 -04:00
Core/DBLayer: Move tables reserved_name, gameobject_respawn and creature_respawn from WORLD database to CHARACTER database as it's content is realm-specific and should be preserved (thanks to leak for the cleanup)
*** TO PRESERVE (COPY) THE DATA CONTAINED IN THE OLD TABLES, YOU MUST FOLLOW THE FOLLOWING SQL-RECIPE (REPLACE DATABASENAMES WHERE NEEDED!) *** -- Move creature_respawn from world to characters db INSERT INTO `characters`.`creature_respawn` (`guid`, `respawntime`, `instance`) SELECT `guid, `respawntime` `instance` * FROM `world`.`creature_respawn`; -- Remove creature_respawn table from world db DROP TABLE `world`.`creature_respawn`; -- Move gameobject_respawn from world to characters db INSERT INTO `characters`.`gameobject_respawn` (`guid`, `respawntime`, `instance`) SELECT `guid`, `respawntime`, `instance` FROM `world`.`gameobject_respawn`; -- Remove creature_respawn table from world db DROP TABLE `world`.`gameobject_respawn`; -- Move reserved names from world to characters db INSERT INTO `characters`.`reserved_name` (`name`) SELECT `name` FROM `world`.`reserved_name`; -- Remove reserved_names table from world db DROP TABLE `world`.`reserved_name`; *** THE ABOVE MUST BE DONE, OR EXISTING INSTANCES WILL BE FULLY RESPAWNED - YOU HAVE BEEN WARNED *** Closes issue 4842. Closes issue 4849. --HG-- branch : trunk
This commit is contained in:
@@ -211,5 +211,9 @@ bool CharacterDatabaseConnection::Open()
|
||||
PrepareStatement(CHAR_CLEAN_GUILD_BANK_TABS, "DELETE FROM guild_bank_tab WHERE guildId NOT IN (SELECT guildid FROM guild)");
|
||||
PrepareStatement(CHAR_CLEAN_GUILD_BANK_RIGHTS, "DELETE FROM guild_bank_right WHERE guildId NOT IN (SELECT guildid FROM guild)");
|
||||
PrepareStatement(CHAR_CLEAN_GUILD_BANK_ITEMS, "DELETE FROM guild_bank_item WHERE guildId NOT IN (SELECT guildid FROM guild)");
|
||||
PrepareStatement(CHAR_DEL_GAMEOBJECT_RESPAWN_TIMES, "DELETE FROM gameobject_respawn WHERE respawntime <= UNIX_TIMESTAMP(NOW())");
|
||||
PrepareStatement(CHAR_DEL_CRESPAWNTIME, "DELETE FROM creature_respawn WHERE guid = ? AND instance = ?");
|
||||
PrepareStatement(CHAR_ADD_CRESPAWNTIME, "INSERT INTO creature_respawn VALUES (?, ?, ?)");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user