aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorleak <leakzx@googlemail.com>2011-04-28 22:34:40 +0200
committerleak <leakzx@googlemail.com>2011-04-28 22:34:40 +0200
commit03365e9a573667f5485f44642b47b05473094474 (patch)
tree7b20b4a98c8bf5e680411708d266ece0ef7890ca /sql
parent5aeb4fe794174c1269b4efcb43556a8b69d2b26a (diff)
Core/ObjectMgr: Refactor sEquipmentStorage
Diffstat (limited to 'sql')
-rw-r--r--sql/base/world_database.sql6
-rw-r--r--sql/updates/world/2011_04_28_01_world_creature_equip_template.sql26
2 files changed, 29 insertions, 3 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql
index 835642bf041..0ca95fb2ab4 100644
--- a/sql/base/world_database.sql
+++ b/sql/base/world_database.sql
@@ -1416,9 +1416,9 @@ DROP TABLE IF EXISTS `creature_equip_template`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `creature_equip_template` (
`entry` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Unique entry',
- `equipentry1` mediumint(8) unsigned NOT NULL DEFAULT '0',
- `equipentry2` mediumint(8) unsigned NOT NULL DEFAULT '0',
- `equipentry3` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `itemEntry1` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `itemEntry2` mediumint(8) unsigned NOT NULL DEFAULT '0',
+ `itemEntry3` mediumint(8) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`entry`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Creature System (Equipment)';
/*!40101 SET character_set_client = @saved_cs_client */;
diff --git a/sql/updates/world/2011_04_28_01_world_creature_equip_template.sql b/sql/updates/world/2011_04_28_01_world_creature_equip_template.sql
new file mode 100644
index 00000000000..1cf6a95395c
--- /dev/null
+++ b/sql/updates/world/2011_04_28_01_world_creature_equip_template.sql
@@ -0,0 +1,26 @@
+ALTER TABLE `creature_equip_template`
+CHANGE `entry` `entry` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL,
+CHANGE `equipentry1` `itemEntry1` MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL,
+CHANGE `equipentry2` `itemEntry2` MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL,
+CHANGE `equipentry3` `itemEntry3` MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL,
+ADD COLUMN `newEntry` INT UNSIGNED AUTO_INCREMENT,
+ADD INDEX(newEntry),
+DROP PRIMARY KEY;
+
+UPDATE `creature_template` ct, `creature_equip_template` cet
+SET ct.`equipment_id` = cet.`newEntry`
+WHERE ct.`equipment_id` = cet.`entry`;
+
+UPDATE `game_event_model_equip` geme, `creature_equip_template` cet
+SET geme.`equipment_id` = cet.`newEntry`
+WHERE geme.`equipment_id` = cet.`entry`;
+
+UPDATE `creature` c, `creature_equip_template` cet
+SET c.`equipment_id` = cet.`newEntry`
+WHERE c.`equipment_id` = cet.`entry`;
+
+UPDATE `creature_equip_template` SET `entry` = `newEntry`;
+
+ALTER TABLE `creature_equip_template`
+ADD PRIMARY KEY(`entry`),
+DROP COLUMN `newEntry`; \ No newline at end of file