# `PhoenixKit.Migrations.Postgres.V92`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.165/lib/phoenix_kit/migrations/postgres/v92.ex#L1)

V92: Add organization accounts support and organization invitations.

## User schema changes

Adds three new columns to `phoenix_kit_users`:
- `account_type` (VARCHAR(20), NOT NULL, DEFAULT 'person') with CHECK constraint
- `organization_name` (VARCHAR(255)) for organization display names
- `organization_uuid` (UUID) self-referencing FK to link persons to organizations

## Organization invitations table

Creates `phoenix_kit_organization_invitations`:
- BYTEA token (SHA-256 hash of raw 32-byte token, unique)
- Status CHECK constraint: pending | accepted | declined | cancelled
- FK to phoenix_kit_users: organization_uuid (CASCADE), invited_by_uuid (SET NULL)
- Partial unique index on (organization_uuid, email) WHERE status = 'pending'

All operations are idempotent.

# `down`

# `up`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
