Revision 2, 1.1 kB
(checked in by yumileroy, 17 years ago)
|
[svn] * Proper SVN structure
Original author: Neo2003
Date: 2008-10-02 16:23:55-05:00
|
Line | |
---|
1 | ALTER TABLE `character_pet` |
---|
2 | ADD COLUMN `slot` tinyint(1) unsigned NOT NULL default '0', |
---|
3 | CHANGE COLUMN `id` `id` int(11) unsigned NOT NULL default '0'; |
---|
4 | |
---|
5 | UPDATE `character_pet` |
---|
6 | SET `slot` = 0 WHERE `current` = 1; |
---|
7 | |
---|
8 | /* slot 3 = for storing warlock and another not stabled pets */ |
---|
9 | UPDATE `character_pet` |
---|
10 | SET `slot` = 3 WHERE `current` = 0; |
---|
11 | |
---|
12 | /* current = (`slot`==0) */ |
---|
13 | ALTER TABLE `character_pet` |
---|
14 | DROP COLUMN `current`; |
---|
15 | |
---|
16 | UPDATE `character_pet`, `character_stable` |
---|
17 | SET `character_pet`.`slot` =`character_stable`.`slot` |
---|
18 | WHERE `character_pet`.`id`=`character_stable`.`petnumber` |
---|
19 | AND `character_pet`.`owner`=`character_stable`.`owner` AND `character_pet`.`id`=`character_stable`.`petnumber`; |
---|
20 | |
---|
21 | ALTER TABLE `character` |
---|
22 | ADD COLUMN `stable_slots` tinyint(1) unsigned NOT NULL default '0'; |
---|
23 | |
---|
24 | UPDATE `character`, ( |
---|
25 | SELECT `character_stable`.`owner` as `owner_slots`, MAX(`character_stable`.`slot`) as `slots` FROM `character_stable` GROUP BY `character_stable`.`owner` |
---|
26 | ) as `stable_slots` |
---|
27 | SET `character`.`stable_slots`= `stable_slots`.`slots` |
---|
28 | WHERE `character`.`guid` = `stable_slots`.`owner_slots`; |
---|
29 | |
---|
30 | |
---|
31 | DROP TABLE IF EXISTS `character_stable`; |
---|