diff --git a/priv/repo/migrations/20250207100755_update_notification_templates_index.exs b/priv/repo/migrations/20250207100755_update_notification_templates_index.exs index d98d94a05..12a9293fc 100644 --- a/priv/repo/migrations/20250207100755_update_notification_templates_index.exs +++ b/priv/repo/migrations/20250207100755_update_notification_templates_index.exs @@ -1,9 +1,14 @@ defmodule Sanbase.Repo.Migrations.UpdateNotificationTemplatesIndex do use Ecto.Migration - def change do - drop(unique_index(:notification_templates, [:action, :step, :channel])) + def up do + execute("DROP INDEX IF EXISTS notification_templates_action_type_step_channel_index") + execute("DROP INDEX IF EXISTS notification_templates_action_type_step_index") create(unique_index(:notification_templates, [:action, :step, :channel, :mime_type])) end + + def down do + :ok + end end