Merge pull request 'Add dark and light theme mode to docs, detection, and button...
[akkoma] / priv / repo / migrations / 20200914105800_add_notification_constraints.exs
1 defmodule Pleroma.Repo.Migrations.AddNotificationConstraints do
2 use Ecto.Migration
3
4 def up do
5 drop(constraint(:notifications, "notifications_activity_id_fkey"))
6
7 alter table(:notifications) do
8 modify(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all),
9 null: false
10 )
11 end
12 end
13
14 def down do
15 drop(constraint(:notifications, "notifications_activity_id_fkey"))
16
17 alter table(:notifications) do
18 modify(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all),
19 null: true
20 )
21 end
22 end
23 end