diff options
author | lain <lain@soykaf.club> | 2020-05-27 12:56:15 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-27 12:56:15 +0200 |
commit | 73f222d76a03e7bfad1aae80e0dc9d2777a94f3e (patch) | |
tree | 9585fe453afcf5da98f79852713d73272552ed0c | |
parent | b8e029b5ea33c9267ac26ab7ba598f1cd7be46c2 (diff) | |
download | pleroma-73f222d76a03e7bfad1aae80e0dc9d2777a94f3e.tar.gz |
Migrations: Make user_id index on notifications better for query.
-rw-r--r-- | priv/repo/migrations/20200527104138_change_notification_user_index.exs | 8 |
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 |