logo

pleroma

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

20210203141144_add_featured_address_to_users.exs (631B)


  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.AddFeaturedAddressToUsers do
  5. use Ecto.Migration
  6. def up do
  7. alter table(:users) do
  8. add(:featured_address, :string)
  9. end
  10. create(index(:users, [:featured_address]))
  11. execute("""
  12. update users set featured_address = concat(ap_id, '/collections/featured') where local = true and featured_address is null;
  13. """)
  14. end
  15. def down do
  16. alter table(:users) do
  17. remove(:featured_address)
  18. end
  19. end
  20. end