logo

pleroma

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

20210401143153_user_notification_settings_fix.exs (579B)


  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.UserNotificationSettingsFix do
  5. use Ecto.Migration
  6. def up do
  7. execute(~s(UPDATE users
  8. SET
  9. notification_settings = '{"followers": true, "follows": true, "non_follows": true, "non_followers": true}'::jsonb WHERE notification_settings IS NULL
  10. ))
  11. execute("ALTER TABLE users
  12. ALTER COLUMN notification_settings SET NOT NULL")
  13. end
  14. def down do
  15. :ok
  16. end
  17. end