Skip to content
Permalink
Browse files

Fixed pet evolution upgrade script (#4232)

This re-adds the missing eggs from before the change into the inventories.

Fixes #4116

Thanks to @Indigo000, @Badarosk0 and @Everade
  • Loading branch information...
Lemongrass3110 committed Jul 7, 2019
1 parent 32525ba commit e6eaa9fe6358847dbf7385eb7d3d218851b1c625
Showing with 29 additions and 0 deletions.
  1. +29 −0 sql-files/upgrades/upgrade_20190309.sql
@@ -10,3 +10,32 @@ WHERE
AND
( `i`.`card1` | ( `i`.`card2` << 16 ) ) = `c`.`pet_id`
;

INSERT INTO `inventory`( `char_id`, `nameid`, `amount`, `equip`, `identify`, `refine`, `attribute`, `card0`, `card1`, `card2`, `card3` )
SELECT
`p`.`char_id`, -- Character ID
`p`.`egg_id`, -- Egg Item ID
'1', -- Amount
'0', -- Equip
'1', -- Identify
'0', -- Refine
'1', -- Attribute
'256', -- Card0
( `p`.`pet_id` & 0xFFFF ), -- Card1
( ( `p`.`pet_id` >> 16 ) & 0xFFFF ), -- Card2
'0' -- Card3
FROM `pet` `p`
LEFT JOIN `inventory` `i`
ON
`i`.`char_id` = `p`.`char_id`
AND
`i`.`nameid` = `p`.`egg_id`
AND
`i`.`card0` = '256'
AND
( `i`.`card1` | ( `i`.`card2` << 16 ) ) = `p`.`pet_id`
WHERE
`p`.`incubate` = '0'
AND
`i`.`id` IS NULL
;

2 comments on commit e6eaa9f

@mazvi

This comment has been minimized.

Copy link
Contributor

replied Jul 11, 2019

i got this

ALTER TABLE pet
ADD COLUMN autofeed tinyint(2) NOT NULL default '0' AFTER incubate

MySQL menyatakan: Dokumentasi
#1060 - Duplicate column name 'autofeed'

@Lemongrass3110

This comment has been minimized.

Copy link
Member Author

replied Jul 11, 2019

@mazvi you already ran this script. You only need to run that new sql statement that i added

Please sign in to comment.
You can’t perform that action at this time.