Add notification deletion to downgrade to respect foreign key constraints

This commit is contained in:
Pea Tyczynska
2019-05-28 15:25:06 +01:00
parent 5f1f688c7b
commit c4d20667a6

View File

@@ -78,5 +78,7 @@ def upgrade():
def downgrade():
op.execute("DELETE FROM templates_history WHERE id = '{}'".format(email_template_id))
op.execute("DELETE FROM notifications WHERE template_id = '{}'".format(email_template_id))
op.execute("DELETE FROM notification_history WHERE template_id = '{}'".format(email_template_id))
op.execute("DELETE FROM templates WHERE id = '{}'".format(email_template_id))
op.execute("DELETE FROM templates_history WHERE id = '{}'".format(email_template_id))