X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/00cfda9f04df9d1622b43d8132cb3293bff0b6d3..e1d623636e7d96d9440f10bdb780f8c76964a9bf:/pokedex/db/tables.py?ds=inline diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 7bf7822..f946078 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -91,6 +91,7 @@ class Pokemon(TableBase): name = Column(Unicode(20), nullable=False) forme_name = Column(Unicode(16)) forme_base_pokemon_id = Column(Integer, ForeignKey('pokemon.id')) + generation_id = Column(Integer, ForeignKey('generations.id')) evolution_chain_id = Column(Integer, ForeignKey('evolution_chains.id'), nullable=False) evolution_parent_pokemon_id = Column(Integer, ForeignKey('pokemon.id')) evolution_method_id = Column(Integer, ForeignKey('evolution_methods.id')) @@ -187,6 +188,7 @@ Pokemon.abilities = relation(Ability, secondary=PokemonAbility.__table__, Pokemon.dex_numbers = relation(PokemonDexNumber, backref='pokemon') Pokemon.evolution_chain = relation(EvolutionChain, backref='pokemon') Pokemon.foreign_names = relation(PokemonName, backref='pokemon') +Pokemon.generation = relation(Generation, backref='pokemon') Pokemon.stats = relation(PokemonStat, backref='pokemon') Pokemon.types = relation(Type, secondary=PokemonType.__table__)