* This stuff does not belong in the core repo
--HG-- branch : trunk
This commit is contained in:
1 parent
4f71c9345d
commit
c093a9735e
16 files changed
+1
-9902
No files matched your search
@@ -1,6 +0,0 @@
|
||||
|
||||
########### install files ###############
|
||||
|
||||
FILE(GLOB _SQL_TOOLS *.sql)
|
||||
|
||||
install(FILES ${_SQL_TOOLS} README DESTINATION share/trinity/sql/tools)
|
||||
@@ -1,38 +0,0 @@
|
||||
# Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
#
|
||||
# Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
## Sub-directories to parse
|
||||
|
||||
## Change installation location
|
||||
# datadir = trinity/sql/tools
|
||||
pkgdatadir = $(datadir)/trinity/sql/tools
|
||||
|
||||
## Files to be installed
|
||||
# Install basic SQL files to datadir
|
||||
pkgdata_DATA = \
|
||||
characters_item_duplicates_remove.sql \
|
||||
characters_pet_data_cleanup.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
EXTRA_DIST = \
|
||||
characters_item_duplicates_remove.sql \
|
||||
characters_pet_data_cleanup.sql \
|
||||
README
|
||||
@@ -1,8 +0,0 @@
|
||||
= Trinity Core -- Database cleanup tools =
|
||||
|
||||
Copyright (C) Trinity Core (http://www.trinitycore.org)
|
||||
|
||||
See the COPYING file for copying conditions.
|
||||
|
||||
These tools can be used to clean a corrupted database. They
|
||||
should only be used when the sevrer is CLOSED.
|
||||
@@ -1,22 +0,0 @@
|
||||
DROP TABLE IF EXISTS item_test;
|
||||
CREATE TABLE item_test
|
||||
SELECT w.`item_guid`,w.`source`,w.`count` FROM
|
||||
(SELECT u.`item_guid`,u.`source`,COUNT(u.`item_guid`) as `count` FROM
|
||||
((SELECT c.`item` as `item_guid`, 'i' as `source` FROM character_inventory c) UNION
|
||||
(SELECT a.`itemguid` as `item_guid`, 'a' as `source` FROM auctionhouse a) UNION
|
||||
(SELECT m.`item_guid` as `item_guid`, 'm' as `source` FROM mail_items m) UNION
|
||||
(SELECT g.`item_guid` as `item_guid`, 'g' as `source` FROM guild_bank_item g)
|
||||
) as u
|
||||
GROUP BY u.`item_guid`
|
||||
) as w
|
||||
WHERE w.`count` > 1;
|
||||
|
||||
DELETE FROM auctionhouse WHERE itemguid IN (SELECT item_guid FROM item_test WHERE `source`='i');
|
||||
DELETE FROM mail_items WHERE item_guid IN (SELECT item_guid FROM item_test WHERE `source`='i');
|
||||
DELETE FROM guild_bank_item WHERE item_guid IN (SELECT item_guid FROM item_test WHERE `source`='i');
|
||||
|
||||
DELETE FROM mail_items WHERE item_guid IN (SELECT item_guid FROM item_test WHERE `source`='a');
|
||||
DELETE FROM guild_bank_item WHERE item_guid IN (SELECT item_guid FROM item_test WHERE `source`='a');
|
||||
|
||||
DELETE FROM guild_bank_item WHERE item_guid IN (SELECT item_guid FROM item_test WHERE `source`='m');
|
||||
DROP TABLE IF EXISTS item_test;
|
||||
@@ -1,3 +0,0 @@
|
||||
DELETE FROM pet_aura WHERE guid NOT IN (SELECT id FROM character_pet);
|
||||
DELETE FROM pet_spell WHERE guid NOT IN (SELECT id FROM character_pet);
|
||||
DELETE FROM pet_spell_cooldown WHERE guid NOT IN (SELECT id FROM character_pet);
|
||||
@@ -1,5 +0,0 @@
|
||||
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.
|
||||
@@ -1,51 +0,0 @@
|
||||
-- --------
|
||||
-- creature_template
|
||||
-- --------
|
||||
|
||||
DROP TABLE IF EXISTS merge_creature_template;
|
||||
CREATE TABLE merge_creature_template
|
||||
SELECT * FROM world2.creature_template WHERE entry NOT IN (SELECT DISTINCT entry FROM creature_template);
|
||||
|
||||
ALTER TABLE merge_creature_template ADD INDEX entry (entry);
|
||||
|
||||
ALTER TABLE merge_creature_template ADD COLUMN spell5 mediumint(8) unsigned NOT NULL default '0' AFTER spell4;
|
||||
ALTER TABLE merge_creature_template ADD COLUMN spell6 mediumint(8) unsigned NOT NULL default '0' AFTER spell5;
|
||||
ALTER TABLE merge_creature_template ADD COLUMN spell7 mediumint(8) unsigned NOT NULL default '0' AFTER spell6;
|
||||
ALTER TABLE merge_creature_template ADD COLUMN spell8 mediumint(8) unsigned NOT NULL default '0' AFTER spell7;
|
||||
ALTER TABLE merge_creature_template ADD COLUMN VehicleId mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER PetSpellDataId;
|
||||
|
||||
INSERT creature_template SELECT * FROM merge_creature_template;
|
||||
|
||||
|
||||
-- --------
|
||||
-- creature_model_info
|
||||
-- --------
|
||||
|
||||
DROP TABLE IF EXISTS merge_creature_model_info;
|
||||
CREATE TABLE merge_creature_model_info
|
||||
SELECT * FROM world2.creature_model_info WHERE modelid NOT IN (SELECT DISTINCT modelid FROM creature_model_info);
|
||||
|
||||
ALTER TABLE merge_creature_model_info ADD INDEX modelid (modelid);
|
||||
|
||||
INSERT creature_model_info SELECT * FROM merge_creature_model_info;
|
||||
|
||||
|
||||
-- --------
|
||||
-- creature
|
||||
-- --------
|
||||
|
||||
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);
|
||||
UPDATE `merge_creature`, `creature_template` SET
|
||||
|
||||
`merge_creature`.`curhealth`=`creature_template`.`minhealth`,`merge_creature`.`curmana`=`creature_template`.`minmana` WHERE `merge_creature`.`id`=`creature_template`.`entry` and
|
||||
|
||||
`creature_template`.`RegenHealth` = '1';
|
||||
ALTER TABLE merge_creature DROP COLUMN guid_new;
|
||||
|
||||
INSERT creature SELECT * FROM merge_creature;
|
||||
@@ -1,8 +0,0 @@
|
||||
DELETE FROM creature WHERE guid IN (SELECT guid FROM merge_creature);
|
||||
DROP TABLE IF EXISTS merge_creature;
|
||||
|
||||
DELETE FROM creature_model_info WHERE modelid IN (SELECT modelid FROM merge_creature_model_info);
|
||||
DROP TABLE IF EXISTS merge_creature_model_info;
|
||||
|
||||
DELETE FROM creature_template WHERE entry IN (SELECT entry FROM merge_creature_template);
|
||||
DROP TABLE IF EXISTS merge_creature_template;
|
||||
@@ -1 +0,0 @@
|
||||
delete from gameobject where id IN (select entry from gameobject_template where type=33);
|
||||
Reference in new issue
Block a user