Skip to content

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

Adjust `api_keys.team_id` index, making it non-unique (#5239)

Adrian Gruntkowskic9a6989bb681
diff --git a/priv/repo/migrations/20250325144254_alter_api_keys_team_id_index.exs b/priv/repo/migrations/20250325144254_alter_api_keys_team_id_index.exs
new file mode 100644
index 0000000000..8575ed1ab6
--- /dev/null
+++ b/priv/repo/migrations/20250325144254_alter_api_keys_team_id_index.exs
@@ -0,0 +1,9 @@
+defmodule Plausible.Repo.Migrations.AlterApiKeysTeamIdIndex do
+ use Ecto.Migration
+
+ def change do
+ drop unique_index(:api_keys, [:team_id, :user_id])
+
+ create index(:api_keys, [:team_id])
+ end
+end