1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Repo.Migrations.CaseInsensivtivity do
8 # Two-steps alters are intentional.
9 # When alter of 2 columns is done in a single operation,
10 # inconsistent failures happen because of index on `email` column.
13 execute("create extension if not exists citext")
15 alter table(:users) do
16 modify(:email, :citext)
19 alter table(:users) do
20 modify(:nickname, :citext)
25 alter table(:users) do
26 modify(:email, :string)
29 alter table(:users) do
30 modify(:nickname, :string)
33 execute("drop extension if exists citext")