summaryrefslogtreecommitdiff
path: root/lib/chessh/schema
diff options
context:
space:
mode:
authorSimponic <loganhunt@simponic.xyz>2023-01-27 22:31:15 -0700
committerGitHub <noreply@github.com>2023-01-27 22:31:15 -0700
commitbb66cd91a3e76e9b746750de51b5edd34b5d2259 (patch)
tree8aa25e9f3bb2fdcee4e5c3d7db71c39c7f71b7e6 /lib/chessh/schema
parent841ea41daea82897b9612e56a47cbc8dd47913c1 (diff)
downloadchessh-bb66cd91a3e76e9b746750de51b5edd34b5d2259.tar.gz
chessh-bb66cd91a3e76e9b746750de51b5edd34b5d2259.zip
Add last move schema, add highlighting in renderer (#13)
Diffstat (limited to 'lib/chessh/schema')
-rw-r--r--lib/chessh/schema/game.ex2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chessh/schema/game.ex b/lib/chessh/schema/game.ex
index b6ff327..b7893f1 100644
--- a/lib/chessh/schema/game.ex
+++ b/lib/chessh/schema/game.ex
@@ -6,6 +6,7 @@ defmodule Chessh.Game do
schema "games" do
field(:fen, :string)
field(:moves, :integer, default: 0)
+ field(:last_move, :string)
field(:turn, Ecto.Enum, values: [:light, :dark], default: :light)
field(:winner, Ecto.Enum, values: [:light, :dark, :none], default: :none)
@@ -25,6 +26,7 @@ defmodule Chessh.Game do
:turn,
:winner,
:status,
+ :last_move,
:light_player_id,
:dark_player_id
])