summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20221219082326_create_player.exs
blob: 2b7d2b6ccfbfa9c46debfa6a791c3a5724eaf3fa (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
    create table(:players) do
      add(:discord_id, :string, null: false)
      add(:username, :string, null: false)
      add(:hashed_password, :string, null: true)
      timestamps()
    end

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