logo

pleroma

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

20170522160642_case_insensivtivity.exs (817B)


  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.CaseInsensivtivity do
  5. use Ecto.Migration
  6. # Two-steps alters are intentional.
  7. # When alter of 2 columns is done in a single operation,
  8. # inconsistent failures happen because of index on `email` column.
  9. def up do
  10. execute("create extension if not exists citext")
  11. alter table(:users) do
  12. modify(:email, :citext)
  13. end
  14. alter table(:users) do
  15. modify(:nickname, :citext)
  16. end
  17. end
  18. def down do
  19. alter table(:users) do
  20. modify(:email, :string)
  21. end
  22. alter table(:users) do
  23. modify(:nickname, :string)
  24. end
  25. execute("drop extension if exists citext")
  26. end
  27. end