add invites

This commit is contained in:
2022-02-25 21:52:17 -05:00
committed by oliviasculley
parent c3f5744ad6
commit 41090c46d0
7 changed files with 486 additions and 47 deletions

View File

@ -9,6 +9,7 @@ defmodule Lokal.Repo.Migrations.CreateUsersAuthTables do
add :email, :citext, null: false
add :hashed_password, :string, null: false
add :confirmed_at, :naive_datetime
add :role, :string
timestamps()
end

View File

@ -0,0 +1,19 @@
defmodule Lokal.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: :delete_all, type: :binary_id)
timestamps()
end
create index(:invites, [:user_id])
end
end