Skip to content

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

add migration (#5472)

RobertJoonas0e9b354a45d8
diff --git a/priv/repo/migrations/20250604115839_add_shared_links_feature_to_enterprise_plans.exs b/priv/repo/migrations/20250604115839_add_shared_links_feature_to_enterprise_plans.exs
new file mode 100644
index 0000000000..751cf22835
--- /dev/null
+++ b/priv/repo/migrations/20250604115839_add_shared_links_feature_to_enterprise_plans.exs
@@ -0,0 +1,15 @@
+defmodule Plausible.Repo.Migrations.AddSharedLinksFeatureToEnterprisePlans do
+ use Ecto.Migration
+
+ def up do
+ execute """
+ UPDATE enterprise_plans
+ SET features = array_append(features, 'shared_links')
+ WHERE NOT ('shared_links' = ANY(features));
+ """
+ end
+
+ def down do
+ raise "irreversible"
+ end
+end