Fix migration
[akkoma] / priv / repo / migrations / 20170522160642_case_insensivtivity.exs
1 defmodule Pleroma.Repo.Migrations.CaseInsensivtivity do
2 use Ecto.Migration
3
4 def up do
5 execute("create extension if not exists citext")
6
7 drop_if_exists(index(:users, [:email]))
8
9 alter table(:users) do
10 modify(:email, :citext)
11 modify(:nickname, :citext)
12 end
13
14 create_if_not_exists(index(:users, [:email]))
15 end
16
17 def down do
18 alter table(:users) do
19 modify(:email, :string)
20 modify(:nickname, :string)
21 end
22
23 execute("drop extension if exists citext")
24 end
25 end