From a1f01d4a2b1ce2a167b7fec1506f3970bf13ea79 Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Mon, 13 Mar 2023 14:13:11 -0600 Subject: Move history (#18) * store move history * Add previous game viewer --- lib/chessh/schema/game.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/chessh/schema') 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 -- cgit v1.2.3-70-g09d2