summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20210401143153_user_notification_settings_fix.exs
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-06-01 11:32:30 -0500
committerAlex Gleason <alex@alexgleason.me>2021-06-01 11:33:11 -0500
commitc435de426d045118ed7be3d77f659f349d2d2245 (patch)
treea4cafffc0aa601c994dfd4c3a480dfd9dd5bfa3b /priv/repo/migrations/20210401143153_user_notification_settings_fix.exs
parent10dfe814795f16d6c32f5b6a7421e3e7c597f1ad (diff)
parent75b94a2f352ea255b0785d0f3ba2c849c8355e04 (diff)
downloadpleroma-c435de426d045118ed7be3d77f659f349d2d2245.tar.gz
pleroma-c435de426d045118ed7be3d77f659f349d2d2245.zip
Merge remote-tracking branch 'pleroma/develop' into cycles-constants
Diffstat (limited to 'priv/repo/migrations/20210401143153_user_notification_settings_fix.exs')
-rw-r--r--priv/repo/migrations/20210401143153_user_notification_settings_fix.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/priv/repo/migrations/20210401143153_user_notification_settings_fix.exs b/priv/repo/migrations/20210401143153_user_notification_settings_fix.exs
new file mode 100644
index 000000000..cf68f1be6
--- /dev/null
+++ b/priv/repo/migrations/20210401143153_user_notification_settings_fix.exs
@@ -0,0 +1,17 @@
+defmodule Pleroma.Repo.Migrations.UserNotificationSettingsFix do
+ use Ecto.Migration
+
+ def up do
+ execute(~s(UPDATE users
+ SET
+ notification_settings = '{"followers": true, "follows": true, "non_follows": true, "non_followers": true}'::jsonb WHERE notification_settings IS NULL
+))
+
+ execute("ALTER TABLE users
+ ALTER COLUMN notification_settings SET NOT NULL")
+ end
+
+ def down do
+ :ok
+ end
+end