Migrations: Make user_id index on notifications better for query.

This commit is contained in:
lain 2020-05-27 12:56:15 +02:00
parent b8e029b5ea
commit 73f222d76a
1 changed files with 8 additions and 0 deletions

View File

@ -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