diff --git a/priv/repo/migrations/20250130121019_drop_unique_page_path_constraint_from_goals.exs b/priv/repo/migrations/20250130121019_drop_unique_page_path_constraint_from_goals.exs new file mode 100644 index 000000000000..aa4a86387fe0 --- /dev/null +++ b/priv/repo/migrations/20250130121019_drop_unique_page_path_constraint_from_goals.exs @@ -0,0 +1,22 @@ +defmodule Plausible.Repo.Migrations.DropUniquePagePathConstraintFromGoals do + use Ecto.Migration + + @disable_ddl_transaction true + @disable_migration_lock true + + # Plausible.Repo.Migrations.GoalsUnique + @old_index unique_index( + :goals, + [:site_id, :page_path], + where: "page_path IS NOT NULL", + name: :goals_page_path_unique + ) + + def up do + drop(@old_index) + end + + def down do + create(@old_index) + end +end