Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
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
676B

  1. defmodule Pleroma.Repo.Migrations.RenameNotificationPrivacyOption do
  2. use Ecto.Migration
  3. def up do
  4. execute(
  5. "UPDATE users SET notification_settings = notification_settings - 'privacy_option' || jsonb_build_object('hide_notification_contents', notification_settings->'privacy_option')
  6. where notification_settings ? 'privacy_option'
  7. and local"
  8. )
  9. end
  10. def down do
  11. execute(
  12. "UPDATE users SET notification_settings = notification_settings - 'hide_notification_contents' || jsonb_build_object('privacy_option', notification_settings->'hide_notification_contents')
  13. where notification_settings ? 'hide_notification_contents'
  14. and local"
  15. )
  16. end
  17. end