2022-12-29 19:21:20 -05:00
|
|
|
defmodule Chessh.Repo.Migrations.AddUserSession do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
|
|
|
create table(:player_sessions) do
|
2022-12-30 07:46:35 -05:00
|
|
|
add(:process, :string)
|
|
|
|
add(:login, :utc_datetime_usec)
|
|
|
|
|
2022-12-29 19:21:20 -05:00
|
|
|
add(:player_id, references(:players))
|
|
|
|
add(:node_id, references(:nodes, type: :string))
|
|
|
|
end
|
2022-12-30 07:46:35 -05:00
|
|
|
|
|
|
|
create(unique_index(:player_sessions, [:process, :node_id]))
|
2022-12-29 19:21:20 -05:00
|
|
|
end
|
|
|
|
end
|