diff options
| author | Alex Gleason <alex@alexgleason.me> | 2020-09-22 13:37:02 -0500 |
|---|---|---|
| committer | Alex Gleason <alex@alexgleason.me> | 2020-09-22 13:37:02 -0500 |
| commit | 3104367931bdd259752fb9e2b7a19ba42a72e614 (patch) | |
| tree | 92d59fed02dded222d51e300269f8a742e4c9c05 /priv/repo/migrations/20200914105800_add_notification_constraints.exs | |
| parent | bf181ca96850f3e5baaf8f3dcd6e11b926fcdeeb (diff) | |
| parent | 02f12ec6253093d8bedaf84d78d0f7e533745e1b (diff) | |
| download | pleroma-3104367931bdd259752fb9e2b7a19ba42a72e614.tar.gz pleroma-3104367931bdd259752fb9e2b7a19ba42a72e614.zip | |
Merge remote-tracking branch 'upstream/develop' into email-fix-develop
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 |
