Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

add migration (#6749)

RobertJoonas17f9fbce3584
diff --git a/priv/repo/migrations/20261006120000_add_team_id_paddle_plan_id_unique_index_to_enterprise_plans.exs b/priv/repo/migrations/20261006120000_add_team_id_paddle_plan_id_unique_index_to_enterprise_plans.exs
new file mode 100644
index 0000000000..1be148f81d
--- /dev/null
+++ b/priv/repo/migrations/20261006120000_add_team_id_paddle_plan_id_unique_index_to_enterprise_plans.exs
@@ -0,0 +1,10 @@
+defmodule Plausible.Repo.Migrations.AddTeamIdPaddlePlanIdUniqueIndexToEnterprisePlans do
+ use Ecto.Migration
+
+ def change do
+ create unique_index(:enterprise_plans, [:team_id, :paddle_plan_id])
+
+ # The previous index is redundant now
+ drop index(:enterprise_plans, [:team_id])
+ end
+end