Migrations: Add index on client_id and client_secret for apps.
authorlain <lain@soykaf.club>
Tue, 26 May 2020 14:46:57 +0000 (16:46 +0200)
committerrinpatch <rinpatch@sdf.org>
Sun, 7 Jun 2020 22:20:48 +0000 (01:20 +0300)
Greatly speeds up app lookup.

priv/repo/migrations/20200526144426_add_apps_indexes.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20200526144426_add_apps_indexes.exs b/priv/repo/migrations/20200526144426_add_apps_indexes.exs
new file mode 100644 (file)
index 0000000..5cb6a04
--- /dev/null
@@ -0,0 +1,7 @@
+defmodule Pleroma.Repo.Migrations.AddAppsIndexes do
+  use Ecto.Migration
+
+  def change do
+    create(index(:apps, [:client_id, :client_secret]))
+  end
+end