Skip to content

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

Remove `teams` feature from custom plans (#5460)

hq1f8c36797ae0d
diff --git a/priv/repo/migrations/20250603104648_remove_teams_from_plan_features.exs b/priv/repo/migrations/20250603104648_remove_teams_from_plan_features.exs
new file mode 100644
index 0000000000..c073471647
--- /dev/null
+++ b/priv/repo/migrations/20250603104648_remove_teams_from_plan_features.exs
@@ -0,0 +1,15 @@
+defmodule Plausible.Repo.Migrations.RemoveTeamsFromPlanFeatures do
+ use Ecto.Migration
+
+ def up do
+ execute """
+ UPDATE enterprise_plans SET features = array(
+ SELECT unnest(features) EXCEPT SELECT unnest('{"teams"}'::varchar[])
+ )
+ """
+ end
+
+ def down do
+ raise "irreversible"
+ end
+end