mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Added machines table.
This commit is contained in:
parent
9f9c29a398
commit
a253df0280
2 changed files with 280 additions and 0 deletions
pokedex/db
|
@ -156,6 +156,12 @@ class LocationArea(TableBase):
|
|||
internal_id = Column(Integer, nullable=False)
|
||||
name = Column(Unicode(64), nullable=True)
|
||||
|
||||
class Machine(TableBase):
|
||||
__tablename__ = 'machines'
|
||||
machine_number = Column(Integer, primary_key=True, nullable=False, autoincrement=False)
|
||||
generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, nullable=False, autoincrement=False)
|
||||
move_id = Column(Integer, ForeignKey('moves.id'), nullable=False)
|
||||
|
||||
class MoveEffect(TableBase):
|
||||
__tablename__ = 'move_effects'
|
||||
id = Column(Integer, primary_key=True, nullable=False)
|
||||
|
@ -376,8 +382,11 @@ EvolutionChain.growth_rate = relation(GrowthRate, backref='evolution_chains')
|
|||
|
||||
LocationArea.location = relation(Location, backref='areas')
|
||||
|
||||
Machine.generation = relation(Generation)
|
||||
|
||||
Move.type = relation(Type, backref='moves')
|
||||
Move.effect = relation(MoveEffect, backref='moves')
|
||||
Move.machines = relation(Machine, backref='move')
|
||||
|
||||
Pokemon.abilities = relation(Ability, secondary=PokemonAbility.__table__,
|
||||
order_by=PokemonAbility.slot,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue