Skip to content
Permalink
Browse files
Follow up to 7cd82d0.
- Fixed SQL queries to convert CARD0_PET to positive value before adjusting table to avoid setting the value to 0.
- Thanks to Cydh.
  • Loading branch information
aleos89 committed Jun 12, 2014
1 parent 7cd82d0 commit 42b29ee81eb0e2aa360fe3e740ea4de1069b666b
Showing with 9 additions and 9 deletions.
  1. +7 −7 sql-files/upgrades/upgrade_20140612.sql
  2. +2 −2 sql-files/upgrades/upgrade_20140612_log.sql
@@ -1,3 +1,10 @@
UPDATE `auction` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `cart_inventory` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `guild_storage` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `inventory` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `mail` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `storage` SET `card0` = 256 WHERE `card0` = -256;

ALTER TABLE `auction` MODIFY `nameid` smallint(5) unsigned NOT NULL default '0';
ALTER TABLE `auction` MODIFY `card0` smallint(5) unsigned NOT NULL default '0';
ALTER TABLE `auction` MODIFY `card1` smallint(5) unsigned NOT NULL default '0';
@@ -85,10 +92,3 @@ ALTER TABLE `mob_db_re` MODIFY `Drop7id` smallint(5) unsigned NOT NULL default '
ALTER TABLE `mob_db_re` MODIFY `Drop8id` smallint(5) unsigned NOT NULL default '0';
ALTER TABLE `mob_db_re` MODIFY `Drop9id` smallint(5) unsigned NOT NULL default '0';
ALTER TABLE `mob_db_re` MODIFY `DropCardid` smallint(5) unsigned NOT NULL default '0';

UPDATE `auction` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `cart_inventory` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `guild_storage` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `inventory` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `mail` SET `card0` = 256 WHERE `card0` = -256;
UPDATE `storage` SET `card0` = 256 WHERE `card0` = -256;
@@ -1,8 +1,8 @@
UPDATE `picklog` SET `card0` = 256 WHERE `card0` = -256;

ALTER TABLE `picklog` MODIFY `nameid` smallint(5) unsigned NOT NULL default '0';
ALTER TABLE `picklog` MODIFY `card0` smallint(5) unsigned NOT NULL default '0';
ALTER TABLE `picklog` MODIFY `card1` smallint(5) unsigned NOT NULL default '0';
ALTER TABLE `picklog` MODIFY `card2` smallint(5) unsigned NOT NULL default '0';
ALTER TABLE `picklog` MODIFY `card3` smallint(5) unsigned NOT NULL default '0';
ALTER TABLE `mvplog` MODIFY `prize` smallint(5) unsigned NOT NULL default '0';

UPDATE `picklog` SET `card0` = 256 WHERE `card0` = -256;

1 comment on commit 42b29ee

@Baalberith6
Copy link
Contributor

@Baalberith6 Baalberith6 commented on 42b29ee Nov 9, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are also losing named items, like Wedding Ring with cards 255 0 -18654 2 translated before this change to a correct charid 187530. Easy fix would be to CAST the values to unsigned before altering tables.

Please sign in to comment.