summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2022-12-30 05:53:15 -0700
committerGitHub <noreply@github.com>2022-12-30 05:53:15 -0700
commit52fbc0b0161d2d30583d7f04eef57a29e441e1d2 (patch)
treef882037a2820973ba6dc5f64206b01dba03266d8 /priv
parentc143bb549c53f2737c41cdfce6cc2598c5489bdc (diff)
parente7d8c61487815bd90ec5834dad5e6f64dd951b53 (diff)
downloadchessh-52fbc0b0161d2d30583d7f04eef57a29e441e1d2.tar.gz
chessh-52fbc0b0161d2d30583d7f04eef57a29e441e1d2.zip
Merge pull request #2 from Simponic/erlang_ssh_server
Erlang ssh server #2
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20221229225556_add_node.exs2
-rw-r--r--priv/repo/migrations/20221229225559_add_user_session.exs6
-rw-r--r--priv/repo/migrations/20221230102253_add_authenticating_column_to_player.exs9
3 files changed, 15 insertions, 2 deletions
diff --git a/priv/repo/migrations/20221229225556_add_node.exs b/priv/repo/migrations/20221229225556_add_node.exs
index f8eace8..11731d9 100644
--- a/priv/repo/migrations/20221229225556_add_node.exs
+++ b/priv/repo/migrations/20221229225556_add_node.exs
@@ -4,7 +4,7 @@ defmodule Chessh.Repo.Migrations.AddNode do
def change do
create table(:nodes, primary_key: false) do
add(:id, :string, primary_key: true)
- add(:last_start, :utc_datetime)
+ add(:last_start, :utc_datetime_usec)
end
end
end
diff --git a/priv/repo/migrations/20221229225559_add_user_session.exs b/priv/repo/migrations/20221229225559_add_user_session.exs
index 6f7a599..330fe2c 100644
--- a/priv/repo/migrations/20221229225559_add_user_session.exs
+++ b/priv/repo/migrations/20221229225559_add_user_session.exs
@@ -3,9 +3,13 @@ defmodule Chessh.Repo.Migrations.AddUserSession do
def change do
create table(:player_sessions) do
- add(:login, :utc_datetime)
+ add(:process, :string)
+ add(:login, :utc_datetime_usec)
+
add(:player_id, references(:players))
add(:node_id, references(:nodes, type: :string))
end
+
+ create(unique_index(:player_sessions, [:process, :node_id]))
end
end
diff --git a/priv/repo/migrations/20221230102253_add_authenticating_column_to_player.exs b/priv/repo/migrations/20221230102253_add_authenticating_column_to_player.exs
new file mode 100644
index 0000000..315aeb6
--- /dev/null
+++ b/priv/repo/migrations/20221230102253_add_authenticating_column_to_player.exs
@@ -0,0 +1,9 @@
+defmodule Chessh.Repo.Migrations.AddAuthenticatingColumnToPlayer do
+ use Ecto.Migration
+
+ def change do
+ alter table(:players) do
+ add(:authentications, :integer, default: 0)
+ end
+ end
+end