logo

pleroma

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

20200401030751_users_add_public_key.exs (524B)


  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.UsersAddPublicKey do
  5. use Ecto.Migration
  6. def up do
  7. alter table(:users) do
  8. add_if_not_exists(:public_key, :text)
  9. end
  10. execute("UPDATE users SET public_key = source_data->'publicKey'->>'publicKeyPem'")
  11. end
  12. def down do
  13. alter table(:users) do
  14. remove_if_exists(:public_key, :text)
  15. end
  16. end
  17. end