diff options
| author | Mark Felder <feld@FreeBSD.org> | 2020-09-23 11:56:22 -0500 |
|---|---|---|
| committer | Mark Felder <feld@FreeBSD.org> | 2020-09-23 11:56:22 -0500 |
| commit | f3a1f9c3bbb7321876a09b3846b5e10ecf4af94f (patch) | |
| tree | bcfd29188a841470cdeca478b1c5a3bbd4cc930a /priv/repo/migrations/20200914105800_add_notification_constraints.exs | |
| parent | 34d7e864db8f9cc7fb73ce2fef8466ce8e09ed85 (diff) | |
| parent | e02101e15c425416975f756aca7f3b058006668d (diff) | |
| download | pleroma-f3a1f9c3bbb7321876a09b3846b5e10ecf4af94f.tar.gz pleroma-f3a1f9c3bbb7321876a09b3846b5e10ecf4af94f.zip | |
Merge branch 'develop' into feature/bulk-confirmation
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 |
