X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/ac52b197ed6dfeb5d7ad8cb2e8f0d5b9f1cdd1d4..3031a2e3f412d6fd4ef397f5336792638d849e83:/pokedex/db/tables.py diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index d2a0e77..cedc6a4 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -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,