zoeys.computer/priv/repo/migrations/20241022033717_create_api_keys.exs
2024-10-22 16:51:56 -04:00

16 lines
380 B
Elixir

defmodule Zoeyscomputer.Repo.Migrations.CreateApiKeys do
use Ecto.Migration
def change do
create table(:api_keys) do
add :token, :string
add :name, :string
add :user_id, references(:users, on_delete: :nothing)
timestamps(type: :utc_datetime)
end
create unique_index(:api_keys, [:token])
create index(:api_keys, [:user_id])
end
end