Added gen 4 location internal ids and some pseudo-locations.
[zzz-pokedex.git] / pokedex / db / tables.py
index e6a7b77..b771dab 100644 (file)
@@ -177,7 +177,6 @@ class EvolutionChain(TableBase):
     __tablename__ = 'evolution_chains'
     id = Column(Integer, primary_key=True, nullable=False)
     growth_rate_id = Column(Integer, ForeignKey('growth_rates.id'), nullable=False)
-    steps_to_hatch = Column(Integer, nullable=False)
     baby_trigger_item = Column(Unicode(12))
 
 class EvolutionTrigger(TableBase):
@@ -294,6 +293,12 @@ class LocationAreaEncounterRate(TableBase):
     version_id = Column(Integer, ForeignKey('versions.id'), primary_key=True, autoincrement=False)
     rate = Column(Integer, nullable=True)
 
+class LocationInternalID(TableBase):
+    __tablename__ = 'location_internal_ids'
+    location_id = Column(Integer, ForeignKey('locations.id'), nullable=False, primary_key=True)
+    generation_id = Column(Integer, ForeignKey('generations.id'), nullable=False, primary_key=True)
+    internal_id = Column(Integer, nullable=False)
+
 class Machine(TableBase):
     __tablename__ = 'machines'
     machine_number = Column(Integer, primary_key=True, nullable=False, autoincrement=False)
@@ -343,6 +348,7 @@ class MoveFlag(TableBase):
 class MoveFlagType(TableBase):
     __tablename__ = 'move_flag_types'
     id = Column(Integer, primary_key=True, nullable=False)
+    identifier = Column(Unicode(16), nullable=False)
     name = Column(Unicode(32), nullable=False)
     description = Column(markdown.MarkdownColumn(128), nullable=False)
 
@@ -456,6 +462,7 @@ class Pokemon(TableBase):
     base_experience = Column(Integer, nullable=False)
     base_happiness = Column(Integer, nullable=False)
     is_baby = Column(Boolean, nullable=False)
+    hatch_counter = Column(Integer, nullable=False)
     has_gen4_fem_sprite = Column(Boolean, nullable=False)
     has_gen4_fem_back_sprite = Column(Boolean, nullable=False)
 
@@ -763,6 +770,9 @@ ItemCategory.pocket = relation(ItemPocket)
 
 ItemFlavorText.version_group = relation(VersionGroup)
 
+ItemInternalID.item = relation(Item, backref='internal_ids')
+ItemInternalID.generation = relation(Generation)
+
 ItemName.language = relation(Language)
 
 ItemPocket.categories = relation(ItemCategory, order_by=ItemCategory.name)
@@ -771,6 +781,9 @@ Location.region = relation(Region, backref='locations')
 
 LocationArea.location = relation(Location, backref='areas')
 
+LocationInternalID.location = relation(Location, backref='internal_ids')
+LocationInternalID.generation = relation(Generation)
+
 Machine.item = relation(Item)
 Machine.version_group = relation(VersionGroup)