2017-05-22 16:10:50 +00:00
|
|
|
defmodule Pleroma.Repo.Migrations.CaseInsensivtivity do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def up do
|
2019-07-02 22:14:40 +00:00
|
|
|
execute("create extension if not exists citext")
|
|
|
|
|
|
|
|
drop_if_exists(index(:users, [:email]))
|
|
|
|
|
2017-05-22 16:10:50 +00:00
|
|
|
alter table(:users) do
|
2019-07-02 22:14:40 +00:00
|
|
|
modify(:email, :citext)
|
|
|
|
modify(:nickname, :citext)
|
2017-05-22 16:10:50 +00:00
|
|
|
end
|
2019-07-02 22:14:40 +00:00
|
|
|
|
|
|
|
create_if_not_exists(index(:users, [:email]))
|
2017-05-22 16:10:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def down do
|
|
|
|
alter table(:users) do
|
2019-07-02 22:14:40 +00:00
|
|
|
modify(:email, :string)
|
|
|
|
modify(:nickname, :string)
|
2017-05-22 16:10:50 +00:00
|
|
|
end
|
2019-07-02 22:14:40 +00:00
|
|
|
|
|
|
|
execute("drop extension if exists citext")
|
2017-05-22 16:10:50 +00:00
|
|
|
end
|
|
|
|
end
|