pleroma/priv/repo/migrations/20221129112022_add_cascade_to_report_notes_on_activity_delete.exs
floatingghost a5b9fb0275
Fixing up deletes a bit (#327)
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/327
2022-12-02 14:44:07 +01:00

20 lines
520 B
Elixir

defmodule Pleroma.Repo.Migrations.AddCascadeToReportNotesOnActivityDelete do
use Ecto.Migration
def up do
drop(constraint(:report_notes, "report_notes_activity_id_fkey"))
alter table(:report_notes) do
modify(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all))
end
end
def down do
drop(constraint(:report_notes, "report_notes_activity_id_fkey"))
alter table(:report_notes) do
modify(:activity_id, references(:activities, type: :uuid))
end
end
end