defmodule Api.Repo.Migrations.AddUniqueIndexToInvites do
  use Ecto.Migration

  def change do
    create unique_index(:invites, [:team_id, :invitee_id])
  end
end

Add unique index to invites table
Add unique index to invites table

portosummerofcode/psc-api