logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

20200602150528_create_chat_message_reference.exs (688B)


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