+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="This ability's unique ID; matches the games' internal ID"))
+ identifier = Column(Unicode(24), nullable=False,
+ info=dict(description="An identifier", format='identifier'))
+ generation_id = Column(Integer, ForeignKey('generations.id'), nullable=False,
+ info=dict(description="The ID of the generation this ability was introduced in", detail=True))
+
+create_translation_table('ability_names', Ability, 'names',
+ relation_lazy='joined',
+ name = Column(Unicode(24), nullable=False, index=True,
+ info=dict(description="The name", format='plaintext', official=True)),
+)
+create_translation_table('ability_prose', Ability, 'prose',
+ effect = Column(markdown.MarkdownColumn(5120), nullable=False,
+ info=dict(description="A detailed description of this ability's effect", format='markdown')),
+ short_effect = Column(markdown.MarkdownColumn(255), nullable=False,
+ info=dict(description="A short summary of this ability's effect", format='markdown')),
+)
+
+class AbilityChangelog(TableBase):
+ """History of changes to abilities across main game versions."""
+ __tablename__ = 'ability_changelog'
+ __singlename__ = 'ability_changelog'
+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="This change's unique ID"))
+ ability_id = Column(Integer, ForeignKey('abilities.id'), nullable=False,
+ info=dict(description="The ID of the ability that changed"))
+ changed_in_version_group_id = Column(Integer, ForeignKey('version_groups.id'), nullable=False,
+ info=dict(description="The ID of the version group in which the ability changed"))
+
+create_translation_table('ability_changelog_prose', AbilityChangelog, 'prose',
+ effect = Column(markdown.MarkdownColumn(255), nullable=False,
+ info=dict(description="A description of the old behavior", format='markdown'))
+)
+
+class AbilityFlavorText(TableBase):
+ u"""In-game flavor text of an ability
+ """
+ __tablename__ = 'ability_flavor_text'
+ ability_id = Column(Integer, ForeignKey('abilities.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="The ID of the ability"))
+ version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="The ID of the version group this flavor text is taken from"))
+ language_id = Column(Integer, ForeignKey('languages.id'), primary_key=True, nullable=False,
+ info=dict(description="The language"))
+ flavor_text = Column(Unicode(64), nullable=False,
+ info=dict(description="The actual flavor text", official=True, format='gametext'))
+
+class Berry(TableBase):
+ u"""A Berry, consumable item that grows on trees
+
+ For data common to all items, such as the name, see the corresponding item entry.
+ """
+ __tablename__ = 'berries'
+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="This Berry's in-game number"))
+ item_id = Column(Integer, ForeignKey('items.id'), nullable=False,
+ info=dict(description="The ID of the item that represents this Berry"))
+ firmness_id = Column(Integer, ForeignKey('berry_firmness.id'), nullable=False,
+ info=dict(description="The ID of this Berry's firmness category"))
+ natural_gift_power = Column(Integer, nullable=True,
+ info=dict(description="Natural Gift's power when used with this Berry"))
+ natural_gift_type_id = Column(Integer, ForeignKey('types.id'), nullable=True,
+ info=dict(description="The ID of the Type that Natural Gift has when used with this Berry"))
+ size = Column(Integer, nullable=False,
+ info=dict(description=u"The size of this Berry, in millimeters"))
+ max_harvest = Column(Integer, nullable=False,
+ info=dict(description="The maximum number of these berries that can grow on one tree in Generation IV"))
+ growth_time = Column(Integer, nullable=False,
+ info=dict(description="Time it takes the tree to grow one stage, in hours. Berry trees go through four of these growth stages before they can be picked."))
+ soil_dryness = Column(Integer, nullable=False,
+ info=dict(description="The speed at which this Berry dries out the soil as it grows. A higher rate means the soil dries more quickly."))
+ smoothness = Column(Integer, nullable=False,
+ info=dict(description="The smoothness of this Berry, used in making Pokéblocks or Poffins"))
+
+class BerryFirmness(TableBase):
+ u"""A Berry firmness, such as "hard" or "very soft".
+ """
+ __tablename__ = 'berry_firmness'
+ __singlename__ = 'berry_firmness'
+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="A unique ID for this firmness"))
+ identifier = Column(Unicode(10), nullable=False,
+ info=dict(description="An identifier", format='identifier'))
+
+create_translation_table('berry_firmness_names', BerryFirmness, 'names',
+ relation_lazy='joined',
+ name = Column(Unicode(10), nullable=False, index=True,
+ info=dict(description="The name", format='plaintext', official=True)),
+)
+
+class BerryFlavor(TableBase):
+ u"""A Berry flavor level.
+ """
+ __tablename__ = 'berry_flavors'
+ berry_id = Column(Integer, ForeignKey('berries.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="The ID of the berry"))
+ contest_type_id = Column(Integer, ForeignKey('contest_types.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="The ID of the flavor"))
+ flavor = Column(Integer, nullable=False,
+ info=dict(description="The level of the flavor in the berry"))
+
+class ContestCombo(TableBase):
+ u"""Combo of two moves in a Contest.
+ """
+ __tablename__ = 'contest_combos'
+ first_move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="The ID of the first move in the combo"))
+ second_move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="The ID of the second and final move in the combo"))