analytics/priv/repo/migrations/20231109090334_add_site_user_preferences.exs
Adrian Gruntkowski 8698b8770b
Create site_user_preferences table and apply LV fix (#3506)
* Create `site_user_preferences` table

* Do not trigger querying on filter text change when there's no change
2023-11-09 12:24:41 +01:00

15 lines
442 B
Elixir

defmodule Plausible.Repo.Migrations.AddSiteUserPreferences do
use Ecto.Migration
def change do
create table(:site_user_preferences) do
add :pinned_at, :naive_datetime
add :user_id, references(:users, on_delete: :delete_all), null: false
add :site_id, references(:sites, on_delete: :delete_all), null: false
timestamps()
end
create unique_index(:site_user_preferences, [:user_id, :site_id])
end
end