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

Added types' generations and pre-gen-IV damage classes.

This commit is contained in:
Zhorken 2009-12-20 01:41:40 -05:00 committed by Eevee
parent 37fa52ed47
commit 4384d56c2c
2 changed files with 24 additions and 19 deletions
pokedex/db

View file

@ -438,6 +438,8 @@ class Type(TableBase):
id = Column(Integer, primary_key=True, nullable=False)
name = Column(Unicode(8), nullable=False)
abbreviation = Column(Unicode(3), nullable=False)
generation_id = Column(Integer, ForeignKey('generations.id'), nullable=False)
damage_class_id = Column(Integer, ForeignKey('move_damage_classes.id'), nullable=False) ## ??? is none; everything else is physical or special
class VersionGroup(TableBase):
__tablename__ = 'version_groups'
@ -578,6 +580,9 @@ Type.target_efficacies = relation(TypeEfficacy,
==TypeEfficacy.target_type_id,
backref='target_type')
Type.generation = relation(Generation, backref='types')
Type.damage_class = relation(MoveDamageClass, backref='types')
Version.version_group = relation(VersionGroup, backref='versions')
Version.generation = association_proxy('version_group', 'generation')