forked from azerothcore/azerothcore-wotlk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account wide Reagent Bank/Bag (azerothcore#67)
- Loading branch information
1 parent
1cfc2e4
commit c03c8e9
Showing
4 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- DB update | ||
START TRANSACTION; | ||
|
||
-- DROP unused column | ||
ALTER TABLE `reagent_bank` DROP COLUMN `character_id`; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- DB update | ||
START TRANSACTION; | ||
|
||
-- ADD NEW COLUMN | ||
ALTER TABLE `reagent_bank` | ||
ADD COLUMN `account_id` INT NOT NULL, | ||
DROP PRIMARY KEY, | ||
ADD PRIMARY KEY (`account_id`, `item_entry`); | ||
|
||
-- UPDATE reagent_bank add account ids | ||
UPDATE `reagent_bank` | ||
INNER JOIN `characters` | ||
ON `reagent_bank`.`character_id` = `characters`.`guid` | ||
SET `reagent_bank`.`account_id` = `characters`.`account`; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
CREATE TABLE IF NOT EXISTS `reagent_bank` ( | ||
`character_id` int NOT NULL, | ||
`account_id` int NOT NULL, | ||
`item_entry` int NOT NULL, | ||
`item_subclass` int NOT NULL, | ||
`amount` int NOT NULL, | ||
PRIMARY KEY (`character_id`,`item_entry`) | ||
PRIMARY KEY (`account_id`,`item_entry`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters