Add French names from B/W for everything. #252
[zzz-pokedex.git] / pokedex / db / tables.py
index b5f1d7d..812fdc2 100644 (file)
@@ -590,7 +590,7 @@ class MoveEffectChangelog(TableBase):
         info=dict(description="The ID of the effect that changed"))
     changed_in_version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False,
         info=dict(description="The ID of the version group in which the effect changed"))
-    effect = Column(markdown.MarkdownColumn(255), nullable=False,
+    effect = Column(markdown.MarkdownColumn(512), nullable=False,
         info=dict(description="A description of the old behavior", format='markdown'))
 
 class MoveFlag(TableBase):
@@ -665,8 +665,8 @@ class Move(TableBase):
         info=dict(description="ID of the move's elemental type"))
     power = Column(SmallInteger, nullable=False,
         info=dict(description="Base power of the move"))
-    pp = Column(SmallInteger, nullable=False,
-        info=dict(description="Base PP (Power Points) of the move"))
+    pp = Column(SmallInteger, nullable=True,
+        info=dict(description="Base PP (Power Points) of the move, nullable if not applicable (e.g. Struggle and Shadow moves)."))
     accuracy = Column(SmallInteger, nullable=True,
         info=dict(description="Accuracy of the move; NULL means it never misses"))
     priority = Column(SmallInteger, nullable=False,
@@ -1264,8 +1264,8 @@ class Type(TableBase):
         info=dict(description=u"An arbitrary 3-letter abbreviation of this type.", format='plaintext'))  # XXX: Or is it not arbitrary?
     generation_id = Column(Integer, ForeignKey('generations.id'), nullable=False,
         info=dict(description=u"The ID of the generation this type first appeared in."))
-    damage_class_id = Column(Integer, ForeignKey('move_damage_classes.id'), nullable=False,
-        info=dict(description=u"The ID of the damage class this type's moves had before Generation IV."))
+    damage_class_id = Column(Integer, ForeignKey('move_damage_classes.id'), nullable=True,
+        info=dict(description=u"The ID of the damage class this type's moves had before Generation IV, null if not applicable (e.g. ???)."))
 
 class TypeName(TableBase):
     u"""An official non-English name of an elemental type."""
@@ -1451,8 +1451,14 @@ MoveChangelog.short_effect = markdown.MoveEffectProperty('short_effect')
 
 MoveEffect.category_map = relation(MoveEffectCategoryMap)
 MoveEffect.categories = association_proxy('category_map', 'category')
+MoveEffect.changelog = relation(MoveEffectChangelog,
+    order_by=MoveEffectChangelog.changed_in_version_group_id.desc(),
+    backref='move_effect',
+)
 MoveEffectCategoryMap.category = relation(MoveEffectCategory)
 
+MoveEffectChangelog.changed_in = relation(VersionGroup, backref='move_effect_changelog')
+
 MoveFlag.flag = relation(MoveFlagType)
 
 MoveFlavorText.version_group = relation(VersionGroup)