aboutsummaryrefslogtreecommitdiff
path: root/sql/base
diff options
context:
space:
mode:
authorMachiavelli <machiavelli.trinity@gmail.com>2011-01-22 19:05:23 +0100
committerMachiavelli <machiavelli.trinity@gmail.com>2011-01-22 19:05:23 +0100
commit920b3b0b37a572f91a7015b09e0575b29b68fd55 (patch)
treefd6fe667e76da4c84b72356368d4bc1ff8991f02 /sql/base
parent5adf9c5d305bb1c7e2f282ce3e5a4cf0fbd5592d (diff)
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.
Diffstat (limited to 'sql/base')
-rw-r--r--sql/base/characters_database.sql1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql
index 27b374df69c..3ca227400db 100644
--- a/sql/base/characters_database.sql
+++ b/sql/base/characters_database.sql
@@ -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 */;