summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20200603122732_add_seen_index_to_chat_message_references.exs
blob: 68efb9cd9484527f136e51647b8155d50241463d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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.AddSeenIndexToChatMessageReferences do
  use Ecto.Migration

  def change do
    create(
      index(:chat_message_references, [:chat_id],
        where: "seen = false",
        name: "unseen_messages_count_index"
      )
    )
  end
end