X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/a8d1ef5fbcb02ebc7d3356ad3e096da6469d9473..686c1ce41669bfd1d0837d37733e5a6a8616389c:/pokedex/db/tables.py diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 958cfb7..59755a7 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -573,7 +573,7 @@ class MoveDamageClass(TableBase): __tablename__ = 'move_damage_classes' id = Column(Integer, primary_key=True, nullable=False, info=dict(description="A numeric ID")) - name = Column(Unicode(8), nullable=False, + name = Column(Unicode(16), nullable=False, info=dict(description="An English name of the class", format='plaintext')) description = Column(Unicode(64), nullable=False, info=dict(description="An English description of the class", format='plaintext')) @@ -1375,7 +1375,7 @@ Machine.item = relation(Item) Machine.version_group = relation(VersionGroup) Move.changelog = relation(MoveChangelog, - order_by=MoveChangelog.changed_in_version_group_id.asc(), + order_by=MoveChangelog.changed_in_version_group_id.desc(), backref='move', ) Move.contest_effect = relation(ContestEffect, backref='moves') @@ -1578,9 +1578,10 @@ Type.foreign_names = relation(TypeName, backref='type') TypeName.language = relation(Language) -Version.version_group = relation(VersionGroup, backref='versions') +Version.version_group = relation(VersionGroup, back_populates='versions') Version.generation = association_proxy('version_group', 'generation') +VersionGroup.versions = relation(Version, order_by=Version.id, back_populates='version_group') VersionGroup.generation = relation(Generation, backref='version_groups') VersionGroup.version_group_regions = relation(VersionGroupRegion, backref='version_group') VersionGroup.regions = association_proxy('version_group_regions', 'region')