veekun / pokedex

more than you ever wanted to know about Pokémon
MIT License
1.45k stars 636 forks source link

forms_switchable is inconsistent for new some mega evolutions #172

Closed tustin2121 closed 8 years ago

tustin2121 commented 8 years ago

There's 20 mega pokemon that are unaccounted for in their base forms's pokemon_species.forms_switchable value. I had to run this on the sqlite database to make it consistent again:

UPDATE `pokemon_species` SET `forms_switchable`=1 WHERE 
`pokemon_species`.`id` IN (SELECT `species`.id 
FROM `pokemon` as pkmn 
JOIN `pokemon_forms` as forms ON pkmn.id = forms.pokemon_id 
JOIN `pokemon_species` as species ON pkmn.species_id = species.id 
WHERE forms.is_mega == 1 AND species.forms_switchable == 0);
eevee commented 8 years ago

Fixed by #177, thanks!