logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

20200626163359_rename_notification_privacy_option.exs (835B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.RenameNotificationPrivacyOption do
  5. use Ecto.Migration
  6. def up do
  7. execute(
  8. "UPDATE users SET notification_settings = notification_settings - 'privacy_option' || jsonb_build_object('hide_notification_contents', notification_settings->'privacy_option')
  9. where notification_settings ? 'privacy_option'
  10. and local"
  11. )
  12. end
  13. def down do
  14. execute(
  15. "UPDATE users SET notification_settings = notification_settings - 'hide_notification_contents' || jsonb_build_object('privacy_option', notification_settings->'hide_notification_contents')
  16. where notification_settings ? 'hide_notification_contents'
  17. and local"
  18. )
  19. end
  20. end