2022-12-19 22:56:59 -05:00
|
|
|
defmodule Chessh.Repo.Migrations.CreatePlayer do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
|
|
|
create table(:players) do
|
2023-01-31 16:01:35 -05:00
|
|
|
add(:discord_id, :string, null: false)
|
2023-02-01 16:57:14 -05:00
|
|
|
add(:username, :string, null: false)
|
2023-01-19 16:04:10 -05:00
|
|
|
add(:hashed_password, :string, null: true)
|
2022-12-19 22:56:59 -05:00
|
|
|
timestamps()
|
|
|
|
end
|
|
|
|
|
2022-12-20 03:06:18 -05:00
|
|
|
create(unique_index(:players, [:username]))
|
2023-01-31 16:01:35 -05:00
|
|
|
create(unique_index(:players, [:discord_id]))
|
2022-12-19 22:56:59 -05:00
|
|
|
end
|
|
|
|
end
|