1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-12-25 04:53:06 +00:00
akkoma/priv/repo/migrations/20170522160642_case_insensivtivity.exs

32 lines
658 B
Elixir
Raw Normal View History

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
2019-07-02 23:14:40 +01:00
execute("create extension if not exists citext")
alter table(:users) do
2019-07-02 23:14:40 +01:00
modify(:email, :citext)
end
2019-07-02 23:14:40 +01:00
alter table(:users) do
modify(:nickname, :citext)
end
end
def down do
alter table(:users) do
2019-07-02 23:14:40 +01:00
modify(:email, :string)
end
alter table(:users) do
2019-07-02 23:14:40 +01:00
modify(:nickname, :string)
end
2019-07-02 23:14:40 +01:00
execute("drop extension if exists citext")
end
end