SQL: Characters db storage type cleanup No. 7 (final) - Note:

- It is _strongly_ recommended to extensively test the recent changes before applying them to live data

- To fully resync the character db layout with TC releases it is recommended to dump the characters table with
mysqldump --no-data characters > characters_database_livedata.sql
and use a diff tool to compare it against sql/base/characters_database.sql
This commit is contained in:
leak committed 2011-01-20 02:11:49 +01:00
1 parent c59ea4726e
commit f7af49291b
16 files changed
+108 -50

No files matched your search

+40 -40
View File
@@ -1871,7 +1871,7 @@ DROP TABLE IF EXISTS `item_soulbound_trade_data`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `item_soulbound_trade_data` (
`itemGuid` int(11) unsigned NOT NULL COMMENT 'Item GUID',
`itemGuid` int(10) unsigned NOT NULL COMMENT 'Item GUID',
`allowedPlayers` text NOT NULL COMMENT 'Space separated GUID list of players who can receive this item in trade',
PRIMARY KEY (`itemGuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Item Refund System';
@@ -1894,10 +1894,10 @@ DROP TABLE IF EXISTS `lag_reports`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lag_reports` (
`report_id` int(10) NOT NULL AUTO_INCREMENT,
`player` int(11) unsigned NOT NULL DEFAULT '0',
`lag_type` int(10) NOT NULL DEFAULT '0',
`map` int(11) NOT NULL DEFAULT '0',
`report_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`player` int(10) unsigned NOT NULL DEFAULT '0',
`lag_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
`map` smallint(5) unsigned NOT NULL DEFAULT '0',
`posX` float NOT NULL DEFAULT '0',
`posY` float NOT NULL DEFAULT '0',
`posZ` float NOT NULL DEFAULT '0',
@@ -1922,19 +1922,19 @@ DROP TABLE IF EXISTS `mail`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mail` (
`id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier',
`id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Identifier',
`messageType` tinyint(3) unsigned NOT NULL DEFAULT '0',
`stationery` tinyint(3) NOT NULL DEFAULT '41',
`mailTemplateId` mediumint(8) unsigned NOT NULL DEFAULT '0',
`sender` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier',
`receiver` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier',
`mailTemplateId` smallint(5) unsigned NOT NULL DEFAULT '0',
`sender` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier',
`receiver` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier',
`subject` longtext,
`body` longtext,
`has_items` tinyint(3) unsigned NOT NULL DEFAULT '0',
`expire_time` bigint(40) NOT NULL DEFAULT '0',
`deliver_time` bigint(40) NOT NULL DEFAULT '0',
`money` int(11) unsigned NOT NULL DEFAULT '0',
`cod` int(11) unsigned NOT NULL DEFAULT '0',
`expire_time` int(10) unsigned NOT NULL DEFAULT '0',
`deliver_time` int(10) unsigned NOT NULL DEFAULT '0',
`money` int(10) unsigned NOT NULL DEFAULT '0',
`cod` int(10) unsigned NOT NULL DEFAULT '0',
`checked` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `idx_receiver` (`receiver`)
@@ -1958,9 +1958,9 @@ DROP TABLE IF EXISTS `mail_items`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `mail_items` (
`mail_id` int(11) NOT NULL DEFAULT '0',
`item_guid` int(11) NOT NULL DEFAULT '0',
`receiver` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier',
`mail_id` int(10) unsigned NOT NULL DEFAULT '0',
`item_guid` int(10) unsigned NOT NULL DEFAULT '0',
`receiver` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Character Global Unique Identifier',
PRIMARY KEY (`mail_id`,`item_guid`),
KEY `idx_receiver` (`receiver`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
@@ -1983,18 +1983,18 @@ DROP TABLE IF EXISTS `pet_aura`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pet_aura` (
`guid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`caster_guid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Full Global Unique Identifier',
`spell` int(11) unsigned NOT NULL DEFAULT '0',
`spell` mediumint(8) unsigned NOT NULL DEFAULT '0',
`effect_mask` tinyint(3) unsigned NOT NULL DEFAULT '0',
`recalculate_mask` tinyint(3) unsigned NOT NULL DEFAULT '0',
`stackcount` tinyint(3) unsigned NOT NULL DEFAULT '1',
`amount0` int(11) NOT NULL DEFAULT '0',
`amount1` int(11) NOT NULL DEFAULT '0',
`amount2` int(11) NOT NULL DEFAULT '0',
`base_amount0` int(11) NOT NULL DEFAULT '0',
`base_amount1` int(11) NOT NULL DEFAULT '0',
`base_amount2` int(11) NOT NULL DEFAULT '0',
`amount0` mediumint(8) NOT NULL,
`amount1` mediumint(8) NOT NULL,
`amount2` mediumint(8) NOT NULL,
`base_amount0` mediumint(8) NOT NULL,
`base_amount1` mediumint(8) NOT NULL,
`base_amount2` mediumint(8) NOT NULL,
`maxduration` int(11) NOT NULL DEFAULT '0',
`remaintime` int(11) NOT NULL DEFAULT '0',
`remaincharges` tinyint(3) unsigned NOT NULL DEFAULT '0',
@@ -2019,9 +2019,9 @@ DROP TABLE IF EXISTS `pet_spell`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pet_spell` (
`guid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`spell` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Spell Identifier',
`active` int(11) unsigned NOT NULL DEFAULT '0',
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`spell` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Spell Identifier',
`active` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`,`spell`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Pet System';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -2043,9 +2043,9 @@ DROP TABLE IF EXISTS `pet_spell_cooldown`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pet_spell_cooldown` (
`guid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier, Low part',
`spell` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Spell Identifier',
`time` bigint(20) unsigned NOT NULL DEFAULT '0',
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier, Low part',
`spell` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'Spell Identifier',
`time` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`,`spell`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -2069,8 +2069,8 @@ DROP TABLE IF EXISTS `petition`;
CREATE TABLE `petition` (
`ownerguid` int(10) unsigned NOT NULL,
`petitionguid` int(10) unsigned DEFAULT '0',
`name` varchar(255) NOT NULL DEFAULT '',
`type` int(10) unsigned NOT NULL DEFAULT '0',
`name` varchar(24) NOT NULL,
`type` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`ownerguid`,`type`),
UNIQUE KEY `index_ownerguid_petitionguid` (`ownerguid`,`petitionguid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Guild System';
@@ -2094,10 +2094,10 @@ DROP TABLE IF EXISTS `petition_sign`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `petition_sign` (
`ownerguid` int(10) unsigned NOT NULL,
`petitionguid` int(11) unsigned NOT NULL DEFAULT '0',
`playerguid` int(11) unsigned NOT NULL DEFAULT '0',
`player_account` int(11) unsigned NOT NULL DEFAULT '0',
`type` int(10) unsigned NOT NULL DEFAULT '0',
`petitionguid` int(10) unsigned NOT NULL DEFAULT '0',
`playerguid` int(10) unsigned NOT NULL DEFAULT '0',
`player_account` int(10) unsigned NOT NULL DEFAULT '0',
`type` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`petitionguid`,`playerguid`),
KEY `Idx_playerguid` (`playerguid`),
KEY `Idx_ownerguid` (`ownerguid`)
@@ -2166,9 +2166,9 @@ DROP TABLE IF EXISTS `worldstates`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `worldstates` (
`entry` mediumint(11) unsigned NOT NULL DEFAULT '0',
`value` bigint(40) unsigned NOT NULL DEFAULT '0',
`comment` text,
`entry` int(10) unsigned NOT NULL DEFAULT '0',
`value` int(10) unsigned NOT NULL DEFAULT '0',
`comment` tinytext,
PRIMARY KEY (`entry`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Variable Saves';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -2192,4 +2192,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2011-01-20 0:59:06
-- Dump completed on 2011-01-20 1:49:32
@@ -0,0 +1,3 @@
ALTER TABLE `item_soulbound_trade_data`
ROW_FORMAT=DEFAULT,
CHANGE `itemGuid` `itemGuid` INT(10) UNSIGNED NOT NULL COMMENT 'Item GUID';
@@ -0,0 +1,6 @@
ALTER TABLE `lag_reports`
ROW_FORMAT=DEFAULT,
CHANGE `report_id` `report_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
CHANGE `player` `player` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `lag_type` `lag_type` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `map` `map` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL;
@@ -0,0 +1,11 @@
ALTER TABLE `mail`
ROW_FORMAT=DEFAULT,
CHANGE `id` `id` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Identifier',
CHANGE `mailTemplateId` `mailTemplateId` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `sender` `sender` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Character Global Unique Identifier',
CHANGE `receiver` `receiver` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Character Global Unique Identifier',
CHANGE `expire_time` `expire_time` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `deliver_time` `deliver_time` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `money` `money` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `cod` `cod` INT(10) UNSIGNED DEFAULT '0' NOT NULL;
@@ -0,0 +1,4 @@
ALTER TABLE `mail_items`
CHANGE `mail_id` `mail_id` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `item_guid` `item_guid` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `receiver` `receiver` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Character Global Unique Identifier';
@@ -0,0 +1,10 @@
ALTER TABLE `pet_aura`
ROW_FORMAT=DEFAULT,
CHANGE `guid` `guid` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Global Unique Identifier',
CHANGE `spell` `spell` MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `amount0` `amount0` MEDIUMINT(8) NOT NULL,
CHANGE `amount1` `amount1` MEDIUMINT(8) NOT NULL,
CHANGE `amount2` `amount2` MEDIUMINT(8) NOT NULL,
CHANGE `base_amount0` `base_amount0` MEDIUMINT(8) NOT NULL,
CHANGE `base_amount1` `base_amount1` MEDIUMINT(8) NOT NULL,
CHANGE `base_amount2` `base_amount2` MEDIUMINT(8) NOT NULL;
@@ -0,0 +1,5 @@
ALTER TABLE `pet_spell`
ROW_FORMAT=DEFAULT,
CHANGE `guid` `guid` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Global Unique Identifier',
CHANGE `spell` `spell` MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Spell Identifier',
CHANGE `active` `active` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL;
@@ -0,0 +1,4 @@
ALTER TABLE `pet_spell_cooldown`
CHANGE `guid` `guid` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Global Unique Identifier, Low part',
CHANGE `spell` `spell` MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Spell Identifier',
CHANGE `time` `time` INT(10) UNSIGNED DEFAULT '0' NOT NULL;
@@ -0,0 +1,4 @@
ALTER TABLE `petition`
ROW_FORMAT=DEFAULT,
CHANGE `name` `name` VARCHAR(24) NOT NULL,
CHANGE `type` `type` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL;
@@ -0,0 +1,6 @@
ALTER TABLE `petition_sign`
ROW_FORMAT=DEFAULT,
CHANGE `petitionguid` `petitionguid` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `playerguid` `playerguid` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `player_account` `player_account` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `type` `type` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL;
@@ -0,0 +1,5 @@
ALTER TABLE `worldstates`
ROW_FORMAT=DEFAULT,
CHANGE `entry` `entry` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `value` `value` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
CHANGE `comment` `comment` TINYTEXT;
+2 -2
View File
@@ -1108,7 +1108,7 @@ void Pet::_LoadSpellCooldowns()
Field *fields = result->Fetch();
uint32 spell_id = fields[0].GetUInt32();
time_t db_time = (time_t)fields[1].GetUInt64();
time_t db_time = time_t(fields[1].GetUInt32());
if (!sSpellStore.LookupEntry(spell_id))
{
@@ -1147,7 +1147,7 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans)
m_CreatureSpellCooldowns.erase(itr++);
else
{
trans->PAppend("INSERT INTO pet_spell_cooldown (guid,spell,time) VALUES ('%u', '%u', '" UI64FMTD "')", m_charmInfo->GetPetNumber(), itr->first, uint64(itr->second));
trans->PAppend("INSERT INTO pet_spell_cooldown (guid,spell,time) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, uint32(itr->second));
++itr;
}
}
+2 -2
View File
@@ -17272,8 +17272,8 @@ void Player::_LoadMail()
m->subject = fields[4].GetString();
m->body = fields[5].GetString();
bool has_items = fields[6].GetBool();
m->expire_time = (time_t)fields[7].GetUInt64();
m->deliver_time = (time_t)fields[8].GetUInt64();
m->expire_time = time_t(fields[7].GetUInt32());
m->deliver_time = time_t(fields[8].GetUInt32());
m->money = fields[9].GetUInt32();
m->COD = fields[10].GetUInt32();
m->checked = fields[11].GetUInt32();
+1 -1
View File
@@ -5701,7 +5701,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
m->sender = fields[2].GetUInt32();
m->receiver = fields[3].GetUInt32();
bool has_items = fields[4].GetBool();
m->expire_time = (time_t)fields[5].GetUInt64();
m->expire_time = time_t(fields[5].GetUInt32());
m->deliver_time = 0;
m->COD = fields[6].GetUInt32();
m->checked = fields[7].GetUInt32();
@@ -260,7 +260,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data)
return;
}
Field *fields = result->Fetch();
uint32 type = fields[0].GetUInt32();
uint32 type = fields[0].GetUInt8();
// if guild petition and has guild => error, return;
if (type == GUILD_CHARTER_TYPE && _player->GetGuildId())
@@ -394,7 +394,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
if (result)
{
Field* fields = result->Fetch();
type = fields[0].GetUInt32();
type = fields[0].GetUInt8();
}
else
{
@@ -614,7 +614,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
return;
Field *fields = result->Fetch();
type = fields[0].GetUInt32();
type = fields[0].GetUInt8();
sLog->outDebug("OFFER PETITION: type %u, GUID1 %u, to player id: %u", type, GUID_LOPART(petitionguid), GUID_LOPART(plguid));
@@ -716,7 +716,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
Field *fields = result->Fetch();
ownerguidlo = fields[0].GetUInt32();
name = fields[1].GetString();
type = fields[2].GetUInt32();
type = fields[2].GetUInt8();
}
else
{
+1 -1
View File
@@ -2772,7 +2772,7 @@ void World::LoadWorldStates()
do
{
Field *fields = result->Fetch();
m_worldstates[fields[0].GetUInt32()] = fields[1].GetUInt64();
m_worldstates[fields[0].GetUInt32()] = fields[1].GetUInt32();
++count;
}
while (result->NextRow());