mirror of
https://github.com/plausible/analytics.git
synced 2024-12-25 10:33:01 +03:00
19 lines
509 B
Elixir
19 lines
509 B
Elixir
|
defmodule Plausible.Repo.Migrations.AddInvitations do
|
||
|
use Ecto.Migration
|
||
|
|
||
|
def change do
|
||
|
create table(:invitations) do
|
||
|
add :email, :string, null: false
|
||
|
add :site_id, references(:sites), null: false
|
||
|
add :inviter_id, references(:users), null: false
|
||
|
add :role, :site_membership_role, null: false
|
||
|
add :invitation_id, :string
|
||
|
|
||
|
timestamps()
|
||
|
end
|
||
|
|
||
|
create unique_index(:invitations, [:site_id, :email])
|
||
|
create unique_index(:invitations, :invitation_id)
|
||
|
end
|
||
|
end
|