summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2023-01-17 14:00:18 -0700
committerGitHub <noreply@github.com>2023-01-17 14:00:18 -0700
commitbdf99b4ee989df1813745e1dfd2983689b09ca85 (patch)
treef2c1c52cc2d51019b742800c24d5761f32495b95 /priv
parent53be77e2c57bac6b861d7c3d1d2d6355816a823b (diff)
downloadchessh-bdf99b4ee989df1813745e1dfd2983689b09ca85.tar.gz
chessh-bdf99b4ee989df1813745e1dfd2983689b09ca85.zip
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
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20230115201050_create_games.exs19
1 files changed, 19 insertions, 0 deletions
diff --git a/priv/repo/migrations/20230115201050_create_games.exs b/priv/repo/migrations/20230115201050_create_games.exs
new file mode 100644
index 0000000..418d1de
--- /dev/null
+++ b/priv/repo/migrations/20230115201050_create_games.exs
@@ -0,0 +1,19 @@
+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