Change the order of delete statements to respect foreign key constraint

This commit is contained in:
Pea Tyczynska
2019-06-28 11:22:12 +01:00
parent 9782b08982
commit 2a5b0f8f17
4 changed files with 6 additions and 6 deletions
@@ -90,6 +90,6 @@ def upgrade():
def downgrade():
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))
op.execute("DELETE FROM template_redacted WHERE template_id = '{}'".format(email_template_id))
op.execute("DELETE FROM templates_history WHERE id = '{}'".format(email_template_id))
op.execute("DELETE FROM templates WHERE id = '{}'".format(email_template_id))