Skip to content

Commit

Permalink
Only drop existing triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
hancush committed Jan 21, 2025
1 parent 62673f3 commit 595f391
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion camp_fin/migrations/0093_auto_20250121_0716.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def drop_triggers(apps, schema_editor):
("transaction_search_update", "camp_fin_transaction"),
("treasurer_search_update", "camp_fin_treasurer"),
):
c.execute("drop trigger {0} on {1}".format(trigger_name, table_name))
c.execute(
"drop trigger if exists {0} on {1}".format(trigger_name, table_name)
)


def add_triggers(apps, schema_editor):
Expand Down

0 comments on commit 595f391

Please sign in to comment.