Merge pull request 'Add dark and light theme mode to docs, detection, and button...
[akkoma] / priv / repo / migrations / 20170522160642_case_insensivtivity.exs
1 defmodule Pleroma.Repo.Migrations.CaseInsensivtivity do
2 use Ecto.Migration
3
4 # Two-steps alters are intentional.
5 # When alter of 2 columns is done in a single operation,
6 # inconsistent failures happen because of index on `email` column.
7
8 def up do
9 execute("create extension if not exists citext")
10
11 alter table(:users) do
12 modify(:email, :citext)
13 end
14
15 alter table(:users) do
16 modify(:nickname, :citext)
17 end
18 end
19
20 def down do
21 alter table(:users) do
22 modify(:email, :string)
23 end
24
25 alter table(:users) do
26 modify(:nickname, :string)
27 end
28
29 execute("drop extension if exists citext")
30 end
31 end