diff --git a/progit/model.py b/progit/model.py index 1d35150..a650d87 100644 --- a/progit/model.py +++ b/progit/model.py @@ -368,7 +368,11 @@ class TagIssue(BASE): __tablename__ = 'tags_issues' tag = sa.Column(sa.Text(), primary_key=True) - issue_id = sa.Column(sa.Integer, primary_key=True) + issue_id = sa.Column( + sa.Integer, + sa.ForeignKey( + 'issues.id', ondelete='CASCADE', onupdate='CASCADE'), + primary_key=True) date_created = sa.Column(sa.DateTime, nullable=False, default=datetime.datetime.utcnow)