Skip to content

Commit

Permalink
Page Scroll Goals: migration step 3 (#5036)
Browse files Browse the repository at this point in the history
* migration: add scroll_threshold to goals

* do not drop the old index yet

* add scroll_threshold field to goal schema + new unique constraint

* adjust test to test what it claims to

* mix format

* add migration
  • Loading branch information
RobertJoonas authored Feb 4, 2025
1 parent 2579bbe commit eb984c3
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit eb984c3

Please sign in to comment.