Redumped encounters for all five gen4 games.
[zzz-pokedex.git] / pokedex / db / tables.py
index afdbe10..b0e9c24 100644 (file)
@@ -89,6 +89,7 @@ class EncounterConditionValue(TableBase):
     id = Column(Integer, primary_key=True, nullable=False)
     encounter_condition_id = Column(Integer, ForeignKey('encounter_conditions.id'), primary_key=False, nullable=False, autoincrement=False)
     name = Column(Unicode(64), nullable=False)
+    default = Column(Boolean, nullable=False)
 
 class EncounterConditionValueMap(TableBase):
     """Maps encounters to the specific conditions under which they occur."""
@@ -116,6 +117,7 @@ class EncounterSlot(TableBase):
 
     __tablename__ = 'encounter_slots'
     id = Column(Integer, primary_key=True, nullable=False)
+    version_group_id = Column(Integer, ForeignKey('version_groups.id'), nullable=False, autoincrement=False)
     encounter_terrain_id = Column(Integer, ForeignKey('encounter_terrain.id'), primary_key=False, nullable=False, autoincrement=False)
     rarity = Column(Integer, nullable=False, autoincrement=False)
 
@@ -438,6 +440,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 +582,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')