--- /dev/null
+id,name,description
+1,National,
+2,Kanto,
+3,New,Gold/Silver/Crystal Johto dex
+4,Hoenn,
+5,Sinnoh,Diamond/Pearl Sinnoh dex
+6,Sinnoh,Platinum Sinnoh dex: extended version of Diamond and Pearl's
+7,Johto,"Heart Gold/Soul Silver Johto dex: Gold, Silver, and Crystal's Johto dex with five added Generation-IV evolutions of Generation-I and Generation-II Pokémon"
+8,Internal ID,IDs used internally in Generation I
contest_effect_id = Column(Integer, ForeignKey('contest_effects.id'), nullable=True)
super_contest_effect_id = Column(Integer, ForeignKey('super_contest_effects.id'), nullable=False)
+class Pokedex(TableBase):
+ __tablename__ = 'pokedexes'
+ id = Column(Integer, primary_key=True, nullable=False)
+ name = Column(Unicode(16), nullable=False)
+ description = Column(Unicode(512))
+
+class PokedexVersionGroup(TableBase):
+ __tablename__ = 'pokedex_version_groups'
+ pokedex_id = Column(Integer, ForeignKey('pokedexes.id'), primary_key=True, nullable=False, autoincrement=False)
+ version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False, autoincrement=False)
+
class Pokemon(TableBase):
"""The core to this whole mess.
class PokemonDexNumber(TableBase):
__tablename__ = 'pokemon_dex_numbers'
pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, nullable=False, autoincrement=False)
- generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, nullable=False, autoincrement=False)
+ pokedex_id = Column(Integer, ForeignKey('pokedexes.id'), primary_key=True, nullable=False, autoincrement=False)
pokedex_number = Column(Integer, nullable=False)
class PokemonEggGroup(TableBase):
MoveName.language = relation(Language)
+Pokedex.version_groups = relation(VersionGroup, secondary=PokedexVersionGroup.__table__)
+
Pokemon.abilities = relation(Ability, secondary=PokemonAbility.__table__,
order_by=PokemonAbility.slot,
backref='pokemon')
Pokemon.stats = relation(PokemonStat, backref='pokemon')
Pokemon.types = relation(Type, secondary=PokemonType.__table__)
-PokemonDexNumber.generation = relation(Generation)
+PokemonDexNumber.pokedex = relation(Pokedex)
PokemonFlavorText.version = relation(Version)