1
0
Fork 0
mirror of https://github.com/veekun/pokedex.git synced 2024-08-20 18:16:34 +00:00

Fix Roserade's Central Kalos dex number and add tests

Roserade and Roselia were mistakenly sharing dex number 72. Presumably
an error from the original X/Y spreadsheet. I guess we never reripped
these after 3DS rom dumping became possible.

Regardless of how it happened, add a test and some database constraints
to ensure that it doesn't happen again.

- Add a test for gaps in pokedex numbers

- Add uniqueness constraints to pokemon_dex_numbers.  A species can
  only appear once per pokedex, and a number cannot be used more than
  once per pokedex.
This commit is contained in:
Andrew Ekstedt 2019-07-16 16:41:09 -07:00
parent f8e7637e9e
commit ad429ab128
3 changed files with 26 additions and 2 deletions
pokedex/db

View file

@ -1771,6 +1771,13 @@ class PokemonDexNumber(TableBase):
pokedex_number = Column(Integer, nullable=False,
doc=u"Number of the Pokémon in that the Pokédex")
__table_args__ = (
UniqueConstraint(pokedex_id, pokedex_number),
UniqueConstraint(pokedex_id, species_id),
{},
)
class PokemonEggGroup(TableBase):
u"""Maps an Egg group to a species; each species belongs to one or two egg groups."""
__tablename__ = 'pokemon_egg_groups'