summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-05-27 12:56:15 +0200
committerlain <lain@soykaf.club>2020-05-27 12:56:15 +0200
commit73f222d76a03e7bfad1aae80e0dc9d2777a94f3e (patch)
tree9585fe453afcf5da98f79852713d73272552ed0c
parentb8e029b5ea33c9267ac26ab7ba598f1cd7be46c2 (diff)
Migrations: Make user_id index on notifications better for query.
-rw-r--r--priv/repo/migrations/20200527104138_change_notification_user_index.exs8
1 files changed, 8 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200527104138_change_notification_user_index.exs b/priv/repo/migrations/20200527104138_change_notification_user_index.exs
new file mode 100644
index 000000000..4dcfe6de9
--- /dev/null
+++ b/priv/repo/migrations/20200527104138_change_notification_user_index.exs
@@ -0,0 +1,8 @@
+defmodule Pleroma.Repo.Migrations.ChangeNotificationUserIndex do
+ use Ecto.Migration
+
+ def change do
+ drop_if_exists(index(:notifications, [:user_id]))
+ create_if_not_exists(index(:notifications, [:user_id, "id desc nulls last"]))
+ end
+end