Add changelog entry for hashtag following
[akkoma] / priv / repo / migrations / 20210420204354_delete_hashtags_objects_cascade.exs
1 defmodule Pleroma.Repo.Migrations.DeleteHashtagsObjectsCascade do
2 use Ecto.Migration
3
4 def up do
5 execute("ALTER TABLE hashtags_objects DROP CONSTRAINT hashtags_objects_object_id_fkey")
6
7 alter table(:hashtags_objects) do
8 modify(:object_id, references(:objects, on_delete: :delete_all))
9 end
10 end
11
12 def down do
13 execute("ALTER TABLE hashtags_objects DROP CONSTRAINT hashtags_objects_object_id_fkey")
14
15 alter table(:hashtags_objects) do
16 modify(:object_id, references(:objects, on_delete: :nothing))
17 end
18 end
19 end