diff options
author | Simponic <loganhunt@simponic.xyz> | 2022-12-29 17:21:20 -0700 |
---|---|---|
committer | Simponic <loganhunt@simponic.xyz> | 2022-12-29 17:21:20 -0700 |
commit | 1a2bdccf124de6207899f59538cc0ed2efc97b5a (patch) | |
tree | 5b582023531c8df637881899ab64d5f5eddd7f3f /priv | |
parent | 10bc34245e8e1e3ba63fb0720d3bcfb1119db921 (diff) | |
download | chessh-1a2bdccf124de6207899f59538cc0ed2efc97b5a.tar.gz chessh-1a2bdccf124de6207899f59538cc0ed2efc97b5a.zip |
Add scalable nodes and user sessions
Diffstat (limited to 'priv')
-rw-r--r-- | priv/repo/migrations/20221229225556_add_node.exs | 10 | ||||
-rw-r--r-- | priv/repo/migrations/20221229225559_add_user_session.exs | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/priv/repo/migrations/20221229225556_add_node.exs b/priv/repo/migrations/20221229225556_add_node.exs new file mode 100644 index 0000000..f8eace8 --- /dev/null +++ b/priv/repo/migrations/20221229225556_add_node.exs @@ -0,0 +1,10 @@ +defmodule Chessh.Repo.Migrations.AddNode do + use Ecto.Migration + + def change do + create table(:nodes, primary_key: false) do + add(:id, :string, primary_key: true) + add(:last_start, :utc_datetime) + end + end +end diff --git a/priv/repo/migrations/20221229225559_add_user_session.exs b/priv/repo/migrations/20221229225559_add_user_session.exs new file mode 100644 index 0000000..6f7a599 --- /dev/null +++ b/priv/repo/migrations/20221229225559_add_user_session.exs @@ -0,0 +1,11 @@ +defmodule Chessh.Repo.Migrations.AddUserSession do + use Ecto.Migration + + def change do + create table(:player_sessions) do + add(:login, :utc_datetime) + add(:player_id, references(:players)) + add(:node_id, references(:nodes, type: :string)) + end + end +end |