Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
688B

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.CreateChatMessageReference do
  5. use Ecto.Migration
  6. def change do
  7. create table(:chat_message_references, primary_key: false) do
  8. add(:id, :uuid, primary_key: true)
  9. add(:chat_id, references(:chats, on_delete: :delete_all), null: false)
  10. add(:object_id, references(:objects, on_delete: :delete_all), null: false)
  11. add(:seen, :boolean, default: false, null: false)
  12. timestamps()
  13. end
  14. create(index(:chat_message_references, [:chat_id, "id desc"]))
  15. end
  16. end