diff options
| author | Mark Felder <feld@FreeBSD.org> | 2020-10-09 11:26:10 -0500 |
|---|---|---|
| committer | Mark Felder <feld@FreeBSD.org> | 2020-10-09 11:26:10 -0500 |
| commit | 04b514c567aa664d2606313d17be69e665a7f1af (patch) | |
| tree | 13f46fd39d8a90837b031b1081b7e20696d6823a /priv/repo/migrations/20200914105800_add_notification_constraints.exs | |
| parent | 55562ca9362d66553ea3638c91174bbeb6c637f1 (diff) | |
| parent | d239bd3ca4348d38c12ab54c7e2e9cb2b825cc3c (diff) | |
| download | pleroma-04b514c567aa664d2606313d17be69e665a7f1af.tar.gz pleroma-04b514c567aa664d2606313d17be69e665a7f1af.zip | |
Merge branch 'develop' into feature/gen-magic
Diffstat (limited to 'priv/repo/migrations/20200914105800_add_notification_constraints.exs')
| -rw-r--r-- | priv/repo/migrations/20200914105800_add_notification_constraints.exs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200914105800_add_notification_constraints.exs b/priv/repo/migrations/20200914105800_add_notification_constraints.exs new file mode 100644 index 000000000..a65c35fd0 --- /dev/null +++ b/priv/repo/migrations/20200914105800_add_notification_constraints.exs @@ -0,0 +1,23 @@ +defmodule Pleroma.Repo.Migrations.AddNotificationConstraints do + use Ecto.Migration + + def up do + drop(constraint(:notifications, "notifications_activity_id_fkey")) + + alter table(:notifications) do + modify(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all), + null: false + ) + end + end + + def down do + drop(constraint(:notifications, "notifications_activity_id_fkey")) + + alter table(:notifications) do + modify(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all), + null: true + ) + end + end +end |
