summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20200527104138_change_notification_user_index.exs
blob: 3c8cb1a3add16a4d19f4ac364fd46ce2215f8d4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only

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