Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | null |
|
|
||||||
| team_id | uuid | 2147483647 | null |
|
|
ID команды |
|||||
| varchar | 255 | null |
|
|
Email приглашаемого |
||||||
| token | varchar | 255 | null |
|
|
Уникальный токен приглашения |
|||||
| created_by | uuid | 2147483647 | null |
|
|
ID отправителя |
|||||
| created_at | timestamptz | 35,6 | null |
|
|
||||||
| expires_at | timestamptz | 35,6 | null |
|
|
Срок действия приглашения |
|||||
| status | varchar | 50 | null |
|
|
Статус: pending, accepted, expired, revoked |
|||||
| accepted_at | timestamptz | 35,6 | √ | null |
|
|
Когда принято |
||||
| updated_at | timestamptz | 35,6 | now() |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| team_invites_pkey | Primary key | Asc | id |
| ix_team_invites_email | Performance | Asc | |
| ix_team_invites_expires | Performance | Asc | expires_at |
| ix_team_invites_team_id | Performance | Asc | team_id |
| ix_team_invites_token | Must be unique | Asc | token |
| uq_team_invites_team_email | Must be unique | Asc/Asc | team_id + email |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| chk_team_invites_status | ((status)::text = ANY ((ARRAY['pending'::character varying, 'accepted'::character varying, 'expired'::character varying, 'revoked'::character varying])::text[])) |
| chk_team_invites_expires | (expires_at > created_at) |

