summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20221219082326_create_player.exs
blob: 4c0c5538e6f3d62fdc5cd36b3c6aedfb84b104c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
defmodule Chessh.Repo.Migrations.CreatePlayer do
  use Ecto.Migration

  def change do
    execute("CREATE EXTENSION IF NOT EXISTS citext", "")

    create table(:players) do
      add(:username, :citext, null: false)
      add(:hashed_password, :string, null: false)
      timestamps()
    end

    create(unique_index(:players, [:username]))
  end
end