Skip to content

Commit

Permalink
Merge pull request #5344 from hypothesis/add-annotation-moderation-un…
Browse files Browse the repository at this point in the history
…ique-constraint

Add unique constraint on `annotation_moderation.annotation_id`
  • Loading branch information
robertknight committed Oct 5, 2018
2 parents f9213ba + 0f91854 commit 94e1059
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion h/models/annotation_moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class AnnotationModeration(Base, Timestamps):

annotation_id = sa.Column(types.URLSafeUUID,
sa.ForeignKey('annotation.id', ondelete='cascade'),
nullable=False)
nullable=False,
unique=True)

#: The annotation which has been flagged.
annotation = sa.orm.relationship('Annotation',
Expand Down

0 comments on commit 94e1059

Please sign in to comment.