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.
20 lines
676 B
20 lines
676 B
4 years ago
|
defmodule Pleroma.Repo.Migrations.RenameNotificationPrivacyOption do
|
||
|
use Ecto.Migration
|
||
|
|
||
|
def up do
|
||
|
execute(
|
||
|
"UPDATE users SET notification_settings = notification_settings - 'privacy_option' || jsonb_build_object('hide_notification_contents', notification_settings->'privacy_option')
|
||
|
where notification_settings ? 'privacy_option'
|
||
|
and local"
|
||
|
)
|
||
|
end
|
||
|
|
||
|
def down do
|
||
|
execute(
|
||
|
"UPDATE users SET notification_settings = notification_settings - 'hide_notification_contents' || jsonb_build_object('privacy_option', notification_settings->'hide_notification_contents')
|
||
|
where notification_settings ? 'hide_notification_contents'
|
||
|
and local"
|
||
|
)
|
||
|
end
|
||
|
end
|