Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Temporary: make room for pre/post migration constraint names (#5942)
Adam Rutkowskie4bc6b87154e
diff --git a/lib/plausible/goal/schema.ex b/lib/plausible/goal/schema.exindex cfd35c9062..2ea63ef632 100644--- a/lib/plausible/goal/schema.ex+++ b/lib/plausible/goal/schema.ex@@ -41,9 +41,14 @@ defmodule Plausible.Goal do|> validate_page_path_for_scroll_goal()|> maybe_put_display_name()|> unique_constraint(:event_name, name: :goals_event_name_unique)+ |> unique_constraint([:page_path, :scroll_threshold],+ name: :goals_pageview_config_unique+ )|> unique_constraint([:page_path, :scroll_threshold],name: :goals_page_path_and_scroll_threshold_unique)+ |> unique_constraint(:display_name, name: :goals_display_name_unique)+ |> unique_constraint(:event_name, name: :goals_event_config_unique)|> unique_constraint(:display_name, name: :goals_site_id_display_name_index)|> validate_length(:event_name, max: @max_event_name_length)|> validate_number(:scroll_threshold,diff --git a/test/plausible/goals_test.exs b/test/plausible/goals_test.exsindex d5a5f33197..30d2345f29 100644--- a/test/plausible/goals_test.exs+++ b/test/plausible/goals_test.exs@@ -105,18 +105,18 @@ defmodule Plausible.GoalsTest dotest "create/2 fails to create the same custom event goal twice" dosite = new_site(){:ok, _} = Goals.create(site, %{"event_name" => "foo bar"})- assert {:error, changeset} = Goals.create(site, %{"event_name" => "foo bar"})- assert {"has already been taken", _} = changeset.errors[:event_name]+ assert {:error, _changeset} = Goals.create(site, %{"event_name" => "foo bar"})+ # assert {"has already been taken", _} = changeset.errors[:display_name]endtest "create/2 fails to create the same currency goal twice" dosite = new_site(){:ok, _} = Goals.create(site, %{"event_name" => "foo bar", "currency" => "EUR"})- assert {:error, changeset} =+ assert {:error, _changeset} =Goals.create(site, %{"event_name" => "foo bar", "currency" => "EUR"})- assert {"has already been taken", _} = changeset.errors[:event_name]+ # assert {"has already been taken", _} = changeset.errors[:display_name]endtest "create/2 fails to create a goal with 'engagement' as event_name (reserved)" do