16 lines
376 B
Elixir
16 lines
376 B
Elixir
|
defmodule DrainCloudCore.Repo.Migrations.Sessions do
|
||
|
use Ecto.Migration
|
||
|
|
||
|
def change do
|
||
|
create table(:sessions) do
|
||
|
add :token, :string
|
||
|
add :user_id, references("users", on_delete: :nothing)
|
||
|
add :user_agent, :string
|
||
|
add :created_at, :utc_datetime
|
||
|
add :expires_at, :utc_datetime
|
||
|
end
|
||
|
|
||
|
create unique_index(:sessions, :token)
|
||
|
end
|
||
|
end
|