projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'sideeffects-test' into 'develop'
[akkoma]
/
priv
/
repo
/
migrations
/
20170522160642_case_insensivtivity.exs
diff --git
a/priv/repo/migrations/20170522160642_case_insensivtivity.exs
b/priv/repo/migrations/20170522160642_case_insensivtivity.exs
index 470a545e566ca8f8f61897aa82002504c9cff134..9a67727e9965830d39e9c2c5bc00b7aacbac855e 100644
(file)
--- a/
priv/repo/migrations/20170522160642_case_insensivtivity.exs
+++ b/
priv/repo/migrations/20170522160642_case_insensivtivity.exs
@@
-1,22
+1,28
@@
defmodule Pleroma.Repo.Migrations.CaseInsensivtivity do
use Ecto.Migration
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
execute("create extension if not exists citext")
def up do
execute("create extension if not exists citext")
- drop_if_exists(index(:users, [:email]))
-
alter table(:users) do
modify(:email, :citext)
alter table(:users) do
modify(:email, :citext)
- modify(:nickname, :citext)
end
end
- create_if_not_exists(index(:users, [:email]))
+ alter table(:users) do
+ modify(:nickname, :citext)
+ end
end
def down do
alter table(:users) do
modify(:email, :string)
end
def down do
alter table(:users) do
modify(:email, :string)
+ end
+
+ alter table(:users) do
modify(:nickname, :string)
end
modify(:nickname, :string)
end