diff options
author | Machiavelli <machiavelli.trinity@gmail.com> | 2011-01-22 19:05:23 +0100 |
---|---|---|
committer | Machiavelli <machiavelli.trinity@gmail.com> | 2011-01-22 19:05:23 +0100 |
commit | 920b3b0b37a572f91a7015b09e0575b29b68fd55 (patch) | |
tree | fd6fe667e76da4c84b72356368d4bc1ff8991f02 | |
parent | 5adf9c5d305bb1c7e2f282ce3e5a4cf0fbd5592d (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.
-rw-r--r-- | sql/base/characters_database.sql | 1 | ||||
-rw-r--r-- | sql/updates/2011_01_22_1_characters_character_inventory.sql | 2 |
2 files changed, 3 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 */; diff --git a/sql/updates/2011_01_22_1_characters_character_inventory.sql b/sql/updates/2011_01_22_1_characters_character_inventory.sql new file mode 100644 index 00000000000..624f6dbc582 --- /dev/null +++ b/sql/updates/2011_01_22_1_characters_character_inventory.sql @@ -0,0 +1,2 @@ +ALTER TABLE `character_inventory` +ADD UNIQUE KEY (`guid`,`bag`,`slot`); |