X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/afad84e435212d2b1a4b93c8791d9d6fc66a3043..be59131a9658bacea22491ccbfa873ef7b110e9d:/pokedex/db/tables.py diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index d15cacf..4271efd 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -293,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) @@ -342,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) @@ -681,6 +688,12 @@ class Type(TableBase): 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 TypeName(TableBase): + __tablename__ = 'type_names' + type_id = Column(Integer, ForeignKey('types.id'), primary_key=True, nullable=False, autoincrement=False) + language_id = Column(Integer, ForeignKey('languages.id'), primary_key=True, nullable=False, autoincrement=False) + name = Column(Unicode(16), nullable=False) + class VersionGroup(TableBase): __tablename__ = 'version_groups' id = Column(Integer, primary_key=True, nullable=False) @@ -763,6 +776,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 +787,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) @@ -946,6 +965,9 @@ Type.target_efficacies = relation(TypeEfficacy, Type.generation = relation(Generation, backref='types') Type.damage_class = relation(MoveDamageClass, backref='types') +Type.foreign_names = relation(TypeName, backref='type') + +TypeName.language = relation(Language) Version.version_group = relation(VersionGroup, backref='versions') Version.generation = association_proxy('version_group', 'generation')