Killed the last blob field (corpse)

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-07-30 15:15:07 +02:00
parent 6624da055a
commit 9bda35c7df
5 changed files with 77 additions and 57 deletions

View File

@@ -1211,7 +1211,13 @@ CREATE TABLE `corpse` (
`zone` int(11) unsigned NOT NULL default '38' COMMENT 'Zone Identifier',
`map` int(11) unsigned NOT NULL default '0' COMMENT 'Map Identifier',
`phaseMask` smallint(5) unsigned NOT NULL default '1',
`data` longtext,
`displayId` int(10) unsigned NOT NULL default '0',
`itemCache` text NOT NULL AFTER `displayId`,
`bytes1` int(10) unsigned NOT NULL default '0',
`bytes2` int(10) unsigned NOT NULL default '0',
`guild` int(10) unsigned NOT NULL default '0',
`flags` int(10) unsigned NOT NULL default '0',
`dynFlags` int(10) unsigned NOT NULL default '0',
`time` bigint(20) unsigned NOT NULL default '0',
`corpse_type` tinyint(3) unsigned NOT NULL default '0',
`instance` int(11) unsigned NOT NULL default '0',
@@ -1720,7 +1726,7 @@ CREATE TABLE `item_instance` (
`enchantments` text NOT NULL,
`randomPropertyId` int(11) NOT NULL default '0',
`durability` int(10) unsigned NOT NULL default '0',
`playedTime` int(10) unsigned NOT NULL default '0';
`playedTime` int(10) unsigned NOT NULL default '0',
`text` longtext,
PRIMARY KEY (`guid`),
KEY `idx_owner_guid` (`owner_guid`)

View File

@@ -0,0 +1,39 @@
ALTER TABLE `corpse`
ADD COLUMN `displayId` int(10) unsigned NOT NULL default '0' AFTER `phaseMask`,
ADD COLUMN `itemCache` text NOT NULL AFTER `displayId`,
ADD COLUMN `bytes1` int(10) unsigned NOT NULL default '0' AFTER `itemCache`,
ADD COLUMN `bytes2` int(10) unsigned NOT NULL default '0' AFTER `bytes1`,
ADD COLUMN `guild` int(10) unsigned NOT NULL default '0' AFTER `bytes2`,
ADD COLUMN `flags` int(10) unsigned NOT NULL default '0' AFTER `guild`,
ADD COLUMN `dynFlags` int(10) unsigned NOT NULL default '0' AFTER `flags`;
UPDATE `corpse` SET
`displayId` = SUBSTRING(`data`,
length(SUBSTRING_INDEX(`data`,' ',10))+2,
length(SUBSTRING_INDEX(`data`,' ',10+1))-length(SUBSTRING_INDEX(data,' ',10))-1),
`itemCache` = SUBSTRING(`data`,
length(SUBSTRING_INDEX(`data`,' ',11))+2,
length(SUBSTRING_INDEX(`data`,' ',29+1))-length(SUBSTRING_INDEX(data,' ',11))-1),
`bytes1` = SUBSTRING(`data`,
length(SUBSTRING_INDEX(`data`,' ',30))+2,
length(SUBSTRING_INDEX(`data`,' ',30+1))-length(SUBSTRING_INDEX(data,' ',30))-1),
`bytes2` = SUBSTRING(`data`,
length(SUBSTRING_INDEX(`data`,' ',31))+2,
length(SUBSTRING_INDEX(`data`,' ',31+1))-length(SUBSTRING_INDEX(data,' ',31))-1),
`guild` = SUBSTRING(`data`,
length(SUBSTRING_INDEX(`data`,' ',32))+2,
length(SUBSTRING_INDEX(`data`,' ',32+1))-length(SUBSTRING_INDEX(data,' ',32))-1),
`flags` = SUBSTRING(`data`,
length(SUBSTRING_INDEX(`data`,' ',33))+2,
length(SUBSTRING_INDEX(`data`,' ',33+1))-length(SUBSTRING_INDEX(data,' ',33))-1),
`dynFlags` = SUBSTRING(`data`,
length(SUBSTRING_INDEX(`data`,' ',34))+2,
length(SUBSTRING_INDEX(`data`,' ',34+1))-length(SUBSTRING_INDEX(data,' ',34))-1);
ALTER TABLE `corpse` DROP `data`;