summaryrefslogtreecommitdiff
path: root/lib/chessh/schema
diff options
context:
space:
mode:
authorLizzy Hunt <elizabeth.hunt@simponic.xyz>2023-03-13 14:13:11 -0600
committerGitHub <noreply@github.com>2023-03-13 14:13:11 -0600
commita1f01d4a2b1ce2a167b7fec1506f3970bf13ea79 (patch)
tree3eb1a991569da428a77155b6e6bb601d00c3eb98 /lib/chessh/schema
parent3cb88323c22e72f36d82ae5ada384311123eae67 (diff)
downloadchessh-a1f01d4a2b1ce2a167b7fec1506f3970bf13ea79.tar.gz
chessh-a1f01d4a2b1ce2a167b7fec1506f3970bf13ea79.zip
Move history (#18)
* store move history * Add previous game viewer
Diffstat (limited to 'lib/chessh/schema')
-rw-r--r--lib/chessh/schema/game.ex5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/chessh/schema/game.ex b/lib/chessh/schema/game.ex
index 55b9ea4..868fec8 100644
--- a/lib/chessh/schema/game.ex
+++ b/lib/chessh/schema/game.ex
@@ -12,6 +12,8 @@ defmodule Chessh.Game do
field(:winner, Ecto.Enum, values: [:light, :dark, :none], default: :none)
field(:status, Ecto.Enum, values: [:continue, :draw, :winner], default: :continue)
+ field(:game_moves, :string)
+
belongs_to(:light_player, Player, foreign_key: :light_player_id)
belongs_to(:dark_player, Player, foreign_key: :dark_player_id)
@@ -31,7 +33,8 @@ defmodule Chessh.Game do
:last_move,
:light_player_id,
:dark_player_id,
- :discord_thread_id
+ :discord_thread_id,
+ :game_moves
])
end
end