chessh/priv/repo/migrations/20230115201050_create_games.exs
Logan Hunt bdf99b4ee9
Persistent game (#5)
* Remove unnecessary server in board

* Initial persistent games

* Remove done chessh README stuff, warning issue

* Show current players and move

* Add promotion

* Merge default changeset on all status
2023-01-17 14:00:18 -07:00

20 lines
424 B
Elixir

defmodule Chessh.Repo.Migrations.CreateGames do
use Ecto.Migration
def change do
create table(:games) do
add(:fen, :string)
add(:moves, :integer, default: 0)
add(:turn, :string)
add(:winner, :string)
add(:status, :string)
add(:light_player_id, references(:players), null: true)
add(:dark_player_id, references(:players), null: true)
timestamps()
end
end
end