X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/86164d3b4df0d8a1854ee0db85a9f2b718ddc6f6..6f593ff7a8d01f886ee87a77fd172dae684fb96d:/pokedex/db/tables.py?ds=sidebyside diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index afdbe10..2f43601 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -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')