chessh/priv/repo/migrations/20221219082326_create_player.exs

16 lines
354 B
Elixir
Raw Normal View History

defmodule Chessh.Repo.Migrations.CreatePlayer do
use Ecto.Migration
def change do
2022-12-20 03:06:18 -05:00
execute("CREATE EXTENSION IF NOT EXISTS citext", "")
create table(:players) do
2022-12-20 03:06:18 -05:00
add(:username, :citext, null: false)
add(:hashed_password, :string, null: false)
timestamps()
end
2022-12-20 03:06:18 -05:00
create(unique_index(:players, [:username]))
end
end