You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
592 B
24 lines
592 B
4 years ago
|
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
|