logo

pleroma

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

20191009154606_add_user_info_columns.exs (3415B)


  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.AddUsersInfoColumns do
  5. use Ecto.Migration
  6. @jsonb_array_default "'[]'::jsonb"
  7. def change do
  8. alter table(:users) do
  9. add_if_not_exists(:banner, :map, default: %{})
  10. add_if_not_exists(:background, :map, default: %{})
  11. add_if_not_exists(:source_data, :map, default: %{})
  12. add_if_not_exists(:note_count, :integer, default: 0)
  13. add_if_not_exists(:follower_count, :integer, default: 0)
  14. add_if_not_exists(:following_count, :integer, default: nil)
  15. add_if_not_exists(:locked, :boolean, default: false, null: false)
  16. add_if_not_exists(:confirmation_pending, :boolean, default: false, null: false)
  17. add_if_not_exists(:password_reset_pending, :boolean, default: false, null: false)
  18. add_if_not_exists(:confirmation_token, :text, default: nil)
  19. add_if_not_exists(:default_scope, :string, default: "public")
  20. add_if_not_exists(:blocks, {:array, :text}, default: [])
  21. add_if_not_exists(:domain_blocks, {:array, :text}, default: [])
  22. add_if_not_exists(:mutes, {:array, :text}, default: [])
  23. add_if_not_exists(:muted_reblogs, {:array, :text}, default: [])
  24. add_if_not_exists(:muted_notifications, {:array, :text}, default: [])
  25. add_if_not_exists(:subscribers, {:array, :text}, default: [])
  26. add_if_not_exists(:deactivated, :boolean, default: false, null: false)
  27. add_if_not_exists(:no_rich_text, :boolean, default: false, null: false)
  28. add_if_not_exists(:ap_enabled, :boolean, default: false, null: false)
  29. add_if_not_exists(:is_moderator, :boolean, default: false, null: false)
  30. add_if_not_exists(:is_admin, :boolean, default: false, null: false)
  31. add_if_not_exists(:show_role, :boolean, default: true, null: false)
  32. add_if_not_exists(:settings, :map, default: nil)
  33. add_if_not_exists(:magic_key, :text, default: nil)
  34. add_if_not_exists(:uri, :text, default: nil)
  35. add_if_not_exists(:hide_followers_count, :boolean, default: false, null: false)
  36. add_if_not_exists(:hide_follows_count, :boolean, default: false, null: false)
  37. add_if_not_exists(:hide_followers, :boolean, default: false, null: false)
  38. add_if_not_exists(:hide_follows, :boolean, default: false, null: false)
  39. add_if_not_exists(:hide_favorites, :boolean, default: true, null: false)
  40. add_if_not_exists(:unread_conversation_count, :integer, default: 0)
  41. add_if_not_exists(:pinned_activities, {:array, :text}, default: [])
  42. add_if_not_exists(:email_notifications, :map, default: %{"digest" => false})
  43. add_if_not_exists(:mascot, :map, default: nil)
  44. add_if_not_exists(:emoji, :map, default: fragment(@jsonb_array_default))
  45. add_if_not_exists(:pleroma_settings_store, :map, default: %{})
  46. add_if_not_exists(:fields, :map, default: fragment(@jsonb_array_default))
  47. add_if_not_exists(:raw_fields, :map, default: fragment(@jsonb_array_default))
  48. add_if_not_exists(:discoverable, :boolean, default: false, null: false)
  49. add_if_not_exists(:invisible, :boolean, default: false, null: false)
  50. add_if_not_exists(:notification_settings, :map, default: %{})
  51. add_if_not_exists(:skip_thread_containment, :boolean, default: false, null: false)
  52. end
  53. end
  54. end