logo

pleroma

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

20210420204354_delete_hashtags_objects_cascade.exs (707B)


  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.DeleteHashtagsObjectsCascade do
  5. use Ecto.Migration
  6. def up do
  7. execute("ALTER TABLE hashtags_objects DROP CONSTRAINT hashtags_objects_object_id_fkey")
  8. alter table(:hashtags_objects) do
  9. modify(:object_id, references(:objects, on_delete: :delete_all))
  10. end
  11. end
  12. def down do
  13. execute("ALTER TABLE hashtags_objects DROP CONSTRAINT hashtags_objects_object_id_fkey")
  14. alter table(:hashtags_objects) do
  15. modify(:object_id, references(:objects, on_delete: :nothing))
  16. end
  17. end
  18. end