logo

pleroma

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

20200401072456_users_add_inboxes.exs (666B)


  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.UsersAddInboxes do
  5. use Ecto.Migration
  6. def up do
  7. alter table(:users) do
  8. add_if_not_exists(:inbox, :text)
  9. add_if_not_exists(:shared_inbox, :text)
  10. end
  11. execute("UPDATE users SET inbox = source_data->>'inbox'")
  12. execute("UPDATE users SET shared_inbox = source_data->'endpoints'->>'sharedInbox'")
  13. end
  14. def down do
  15. alter table(:users) do
  16. remove_if_exists(:inbox, :text)
  17. remove_if_exists(:shared_inbox, :text)
  18. end
  19. end
  20. end