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);
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: