logo

pleroma

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

20200914105800_add_notification_constraints.exs (751B)


  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.AddNotificationConstraints do
  5. use Ecto.Migration
  6. def up do
  7. drop(constraint(:notifications, "notifications_activity_id_fkey"))
  8. alter table(:notifications) do
  9. modify(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all),
  10. null: false
  11. )
  12. end
  13. end
  14. def down do
  15. drop(constraint(:notifications, "notifications_activity_id_fkey"))
  16. alter table(:notifications) do
  17. modify(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all),
  18. null: true
  19. )
  20. end
  21. end
  22. end