Update migration that failed to run (#5946)

* Update migration that failed to run

* !fixup
This commit is contained in:
Adam Rutkowski 2025-12-11 13:49:36 +01:00 committed by GitHub
parent 40f0d4bfbf
commit c78ddf6ba4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 1 deletions

View File

@ -2,8 +2,23 @@ defmodule Plausible.Repo.Migrations.GoalsCustomPropsDefault do
use Ecto.Migration
def change do
drop(
unique_index(:goals, [:site_id, :event_name, :custom_props],
where: "event_name IS NOT NULL",
name: :goals_event_config_unique
)
)
alter table(:goals) do
modify(:custom_props, :map, null: false, default: %{})
end
remove :custom_props
add :custom_props, :map, null: false, default: %{}
end
create(
unique_index(:goals, [:site_id, :event_name, :custom_props],
where: "event_name IS NOT NULL",
name: :goals_event_config_unique
)
)
end
end