cannery/priv/repo/migrations/20210904211727_create_invites.exs

20 lines
494 B
Elixir
Raw Permalink Normal View History

2021-09-10 00:23:26 -04:00
defmodule Cannery.Repo.Migrations.CreateInvites do
use Ecto.Migration
def change do
create table(:invites, primary_key: false) do
add :id, :binary_id, primary_key: true
add :name, :string
add :token, :string
add :uses_left, :integer, default: nil
add :disabled_at, :naive_datetime, default: nil
2021-09-12 19:06:26 -04:00
add :user_id, references(:users, on_delete: :delete_all, type: :binary_id)
2021-09-10 00:23:26 -04:00
timestamps()
end
create index(:invites, [:user_id])
end
end