1 ALTER TABLE `guild_bank_item`
2 ADD COLUMN `item_entry` int(11) unsigned NOT NULL default '0',
3 ADD KEY `item_guid_key` (`item_guid`),
4 ADD KEY `guildid_key` (`guildid`);
6 UPDATE `guild_bank_item` ,`item_instance`
7 SET `guild_bank_item`.`item_entry` = SUBSTRING_INDEX(SUBSTRING_INDEX(`item_instance`.`data`, ' ', 4), ' ', -1)
8 WHERE `guild_bank_item`.`item_guid` = `item_instance`.`guid`;