Merge branch 'develop' into command-available-check
[akkoma] / priv / repo / migrations / 20200626163359_rename_notification_privacy_option.exs
1 defmodule Pleroma.Repo.Migrations.RenameNotificationPrivacyOption do
2 use Ecto.Migration
3
4 def up do
5 execute(
6 "UPDATE users SET notification_settings = notification_settings - 'privacy_option' || jsonb_build_object('hide_notification_contents', notification_settings->'privacy_option')
7 where notification_settings ? 'privacy_option'
8 and local"
9 )
10 end
11
12 def down do
13 execute(
14 "UPDATE users SET notification_settings = notification_settings - 'hide_notification_contents' || jsonb_build_object('privacy_option', notification_settings->'hide_notification_contents')
15 where notification_settings ? 'hide_notification_contents'
16 and local"
17 )
18 end
19 end