add invite model

This commit is contained in:
2021-09-10 00:23:26 -04:00
committed by oliviasculley
parent 8fb87a4fda
commit fd5ebcce67
11 changed files with 586 additions and 0 deletions

View File

@ -0,0 +1,18 @@
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
add :user_id, references(:users, on_delete: :nothing, type: :binary_id)
timestamps()
end
create index(:invites, [:user_id])
end
end