68efb9cd9484527f136e51647b8155d50241463d
[anni] / priv / repo / migrations / 20200603122732_add_seen_index_to_chat_message_references.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Repo.Migrations.AddSeenIndexToChatMessageReferences do
6   use Ecto.Migration
7
8   def change do
9     create(
10       index(:chat_message_references, [:chat_id],
11         where: "seen = false",
12         name: "unseen_messages_count_index"
13       )
14     )
15   end
16 end