diff --git a/progit/hooks/irc.py b/progit/hooks/irc.py index cb7f6b6..bb23ae0 100644 --- a/progit/hooks/irc.py +++ b/progit/hooks/irc.py @@ -47,7 +47,8 @@ class IrcTable(BASE): ssl = sa.Column(sa.Boolean, nullable=False, default=True) project = relation( - 'Project', remote_side=[Project.id], backref='irc_hook') + 'Project', remote_side=[Project.id], backref='irc_hook', + cascade="delete, delete-orphan", single_parent=True) class IrcForm(wtf.Form): diff --git a/progit/hooks/mail.py b/progit/hooks/mail.py index f95f1e8..77e05be 100644 --- a/progit/hooks/mail.py +++ b/progit/hooks/mail.py @@ -42,7 +42,8 @@ class MailTable(BASE): active = sa.Column(sa.Boolean, nullable=False, default=False) project = relation( - 'Project', remote_side=[Project.id], backref='mail_hook') + 'Project', remote_side=[Project.id], backref='mail_hook', + cascade="delete, delete-orphan", single_parent=True) class MailForm(wtf.Form): diff --git a/progit/hooks/progit_hook.py b/progit/hooks/progit_hook.py index aadfae5..197531d 100644 --- a/progit/hooks/progit_hook.py +++ b/progit/hooks/progit_hook.py @@ -41,7 +41,8 @@ class ProgitTable(BASE): active = sa.Column(sa.Boolean, nullable=False, default=False) project = relation( - 'Project', remote_side=[Project.id], backref='progit_hook') + 'Project', remote_side=[Project.id], backref='progit_hook', + cascade="delete, delete-orphan", single_parent=True) class ProgitForm(wtf.Form): diff --git a/progit/hooks/progit_ticket_hook.py b/progit/hooks/progit_ticket_hook.py index 7dfdba8..9cb36fb 100644 --- a/progit/hooks/progit_ticket_hook.py +++ b/progit/hooks/progit_ticket_hook.py @@ -41,7 +41,8 @@ class ProgitTicketsTable(BASE): active = sa.Column(sa.Boolean, nullable=False, default=False) project = relation( - 'Project', remote_side=[Project.id], backref='progit_hook_tickets') + 'Project', remote_side=[Project.id], backref='progit_hook_tickets', + cascade="delete, delete-orphan", single_parent=True) class ProgitTicketsForm(wtf.Form):