draincloud-beam-core/priv/repo/migrations/20240917204624_sessions.exs

16 lines
376 B
Elixir
Raw Permalink Normal View History

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