move to 2.5.5
[anni] / priv / repo / migrations / 20190801154554_create_conversation_participation_recipient_ships.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.CreateConversationParticipationRecipientShips do
6   use Ecto.Migration
7
8   def change do
9     create_if_not_exists table(:conversation_participation_recipient_ships) do
10       add(:user_id, references(:users, type: :uuid, on_delete: :delete_all))
11       add(:participation_id, references(:conversation_participations, on_delete: :delete_all))
12     end
13
14     create_if_not_exists(index(:conversation_participation_recipient_ships, [:user_id]))
15     create_if_not_exists(index(:conversation_participation_recipient_ships, [:participation_id]))
16   end
17 end