Core/SQL: Add unique table key for (guid, bag, slot) in character_inventory to prevent storing different item entities in the same slot.

NOTE: If you get import errors it's YOUR OWN RESPONSIBILITY to fix current data inconsistencies your database might have.
This commit is contained in:
Machiavelli
2011-01-22 19:05:23 +01:00
parent 5adf9c5d30
commit 920b3b0b37
2 changed files with 3 additions and 0 deletions

View File

@@ -669,6 +669,7 @@ CREATE TABLE `character_inventory` (
`slot` tinyint(3) unsigned NOT NULL DEFAULT '0',
`item` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Item Global Unique Identifier',
PRIMARY KEY (`item`),
UNIQUE KEY (`guid`,`bag`,`slot`),
KEY `idx_guid` (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System';
/*!40101 SET character_set_client = @saved_cs_client */;