Added index on [:target_id, :relationship_type] to :user_relationships (speeds up...
authorIvan Tashkinov <ivantashkinov@gmail.com>
Wed, 29 Dec 2021 08:41:21 +0000 (11:41 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Wed, 29 Dec 2021 08:41:21 +0000 (11:41 +0300)
priv/repo/migrations/20211229075801_user_relationships_target_id_relationship_type_index.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20211229075801_user_relationships_target_id_relationship_type_index.exs b/priv/repo/migrations/20211229075801_user_relationships_target_id_relationship_type_index.exs
new file mode 100644 (file)
index 0000000..fcefa65
--- /dev/null
@@ -0,0 +1,9 @@
+defmodule Pleroma.Repo.Migrations.UserRelationshipsTargetIdRelationshipTypeIndex do
+  use Ecto.Migration
+
+  def change do
+    create_if_not_exists(
+      index(:user_relationships, [:target_id, :relationship_type])
+    )
+  end
+end