Browse Source

Migrations: Add unique index to ChatMessageReferences.

1570-levenshtein-distance-user-search
lain 4 years ago
parent
commit
6413e06a86
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      priv/repo/migrations/20200603105113_add_unique_index_to_chat_message_references.exs

+ 14
- 0
priv/repo/migrations/20200603105113_add_unique_index_to_chat_message_references.exs View File

@@ -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

Loading…
Cancel
Save