Migrations: Add chat_id, seen index to ChatMessageReferences

This ensures fast count of unseen messages
This commit is contained in:
lain 2020-06-03 14:32:19 +02:00
parent 1e9efcf7c3
commit 7b79871e97

View File

@ -0,0 +1,12 @@
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