You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
akkoma-cachapa/priv/repo/migrations/20170522160642_case_insensi...

32 lines
658 B

defmodule Pleroma.Repo.Migrations.CaseInsensivtivity do
use Ecto.Migration
# Two-steps alters are intentional.
# When alter of 2 columns is done in a single operation,
# inconsistent failures happen because of index on `email` column.
def up do
5 years ago
execute("create extension if not exists citext")
alter table(:users) do
5 years ago
modify(:email, :citext)
end
5 years ago
alter table(:users) do
modify(:nickname, :citext)
end
end
def down do
alter table(:users) do
5 years ago
modify(:email, :string)
end
alter table(:users) do
5 years ago
modify(:nickname, :string)
end
5 years ago
execute("drop extension if exists citext")
end
end