Skip to content

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

Migration extracted form #6143 (#6166)

Adam Rutkowski4ef4bc62c3d9
diff --git a/priv/repo/migrations/20260312000000_replace_sites_sort_preference_with_sort_index_options.exs b/priv/repo/migrations/20260312000000_replace_sites_sort_preference_with_sort_index_options.exs
new file mode 100644
index 0000000000..9e32aae9f5
--- /dev/null
+++ b/priv/repo/migrations/20260312000000_replace_sites_sort_preference_with_sort_index_options.exs
@@ -0,0 +1,19 @@
+defmodule Plausible.Repo.Migrations.ReplaceSitesSortPreferenceWithSortIndexOptions do
+ use Ecto.Migration
+
+ def up do
+ alter table(:team_membership_user_preferences) do
+ remove :sites_sort_by
+ remove :sites_sort_direction
+ add :sort_index_options, :map, null: false, default: "{}"
+ end
+ end
+
+ def down do
+ alter table(:team_membership_user_preferences) do
+ remove :sort_index_options, :map
+ add :sites_sort_by, :string, null: true
+ add :sites_sort_direction, :string, null: true
+ end
+ end
+end