1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Repo.Migrations.CreateChatMessageReference do
9 create table(:chat_message_references, primary_key: false) do
10 add(:id, :uuid, primary_key: true)
11 add(:chat_id, references(:chats, on_delete: :delete_all), null: false)
12 add(:object_id, references(:objects, on_delete: :delete_all), null: false)
13 add(:seen, :boolean, default: false, null: false)
18 create(index(:chat_message_references, [:chat_id, "id desc"]))