18 lines
313 B
Elixir
18 lines
313 B
Elixir
defmodule Comfycamp.Repo.Migrations.AddUsernames do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
alter table(:users) do
|
|
add :username, :citext
|
|
end
|
|
|
|
execute("""
|
|
UPDATE users
|
|
SET username = email
|
|
""")
|
|
|
|
alter table(:users) do
|
|
modify :username, :citext, null: false
|
|
end
|
|
end
|
|
end
|