mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
*Add some sql tools to merge two db. This is only a template and is pushed for dev use. Do not use it unless you understand it and know how to modify it.
--HG-- branch : trunk
This commit is contained in:
5
sql/tools/world_merge_db/readme.txt
Normal file
5
sql/tools/world_merge_db/readme.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
Suppose your primary db is called "world", and you have another db called "world2". By running world_merge_xxx.sql you can copy some spawn points which do not exist in "world" from "world2" to "world".
|
||||
|
||||
If you want to apply a update pack to "world", first run world_remove_merged_xxx to remove the merged spawn points of "world2" from "world", then apply update packet, then re-apply world_merge_xxx.sql. Make sure to do that clean up every time you use a update pack on "world" or "world2". Otherwise your db will be messed up.
|
||||
|
||||
Do not use these sql unless you can understand them.
|
||||
13
sql/tools/world_merge_db/world_merge_creature.sql
Normal file
13
sql/tools/world_merge_db/world_merge_creature.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
DROP TABLE IF EXISTS merge_creature;
|
||||
|
||||
CREATE TABLE merge_creature
|
||||
(guid_new INT NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT * FROM world2.creature WHERE id NOT IN (SELECT DISTINCT id FROM creature);
|
||||
|
||||
ALTER TABLE merge_creature ADD INDEX guid (guid);
|
||||
|
||||
UPDATE merge_creature SET guid = guid_new + (SELECT MAX(guid) FROM creature);
|
||||
|
||||
ALTER TABLE merge_creature DROP COLUMN guid_new;
|
||||
|
||||
INSERT creature SELECT * FROM merge_creature;
|
||||
@@ -0,0 +1,2 @@
|
||||
DELETE FROM creature WHERE guid IN (SELECT guid FROM merge_creature);
|
||||
DROP TABLE IF EXISTS merge_creature;
|
||||
Reference in New Issue
Block a user