From: lain Date: Wed, 3 Jun 2020 11:13:44 +0000 (+0200) Subject: Migrations: Add unique index to ChatMessageReferences. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=6413e06a861bd383196c79d7754a67d96cd5e2a4;p=akkoma Migrations: Add unique index to ChatMessageReferences. --- diff --git a/priv/repo/migrations/20200603105113_add_unique_index_to_chat_message_references.exs b/priv/repo/migrations/20200603105113_add_unique_index_to_chat_message_references.exs new file mode 100644 index 000000000..1101be94f --- /dev/null +++ b/priv/repo/migrations/20200603105113_add_unique_index_to_chat_message_references.exs @@ -0,0 +1,14 @@ +defmodule Pleroma.Repo.Migrations.BackfillChatMessageReferences do + use Ecto.Migration + + alias Pleroma.Chat + alias Pleroma.ChatMessageReference + alias Pleroma.Object + alias Pleroma.Repo + + import Ecto.Query + + def change do + create(unique_index(:chat_message_references, [:object_id, :chat_id])) + end +end