diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 05e5bb9..b05f9b3 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -1103,7 +1103,7 @@ class Location(TableBase): doc=u"A numeric ID") region_id = Column(Integer, ForeignKey('regions.id'), doc=u"ID of the region this location is in") - identifier = Column(Unicode(79), nullable=False, + identifier = Column(Unicode(79), nullable=False, unique=True, doc=u"An identifier", info=dict(format='identifier')) @@ -1133,6 +1133,11 @@ class LocationArea(TableBase): doc=u"An identifier", info=dict(format='identifier')) + __table_args__ = ( + UniqueConstraint(location_id, identifier), + {}, + ) + create_translation_table('location_area_prose', LocationArea, 'prose', relation_lazy='joined', name = Column(Unicode(79), nullable=True, index=True,