X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/8df292954aad77e7934d6bbf523fcff626cfd33c..d0920eda35f242a14502a14f89e81d9d0309930f:/pokedex/db/tables.py diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 76bd753..f8afa9b 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -28,7 +28,7 @@ The singular-name property returns the name in the default language, English. import collections -from sqlalchemy import Column, ForeignKey, MetaData, PrimaryKeyConstraint, Table +from sqlalchemy import Column, ForeignKey, MetaData, PrimaryKeyConstraint, Table, UniqueConstraint from sqlalchemy.ext.declarative import ( declarative_base, declared_attr, DeclarativeMeta, ) @@ -689,6 +689,11 @@ class MoveEffectChangelog(TableBase): effect = ProseColumn(markdown.MarkdownColumn(512), plural='effects', nullable=False, info=dict(description="A description of the old behavior", format='markdown')) + __table_args__ = ( + UniqueConstraint(effect_id, changed_in_version_group_id), + {}, + ) + class MoveFlag(TableBase): u"""Maps a move flag to a move """