Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | null |
|
|
||||||
| team_id | uuid | 2147483647 | null |
|
|
ID команды |
|||||
| from_user_id | uuid | 2147483647 | null |
|
|
ID текущего владельца (инициатор) |
|||||
| to_user_email | text | 2147483647 | null |
|
|
Email получателя (нового владельца) |
|||||
| to_user_id | uuid | 2147483647 | √ | null |
|
|
ID получателя (заполняется при создании) |
||||
| status | varchar | 50 | null |
|
|
Статус: pending, accepted, declined, expired, cancelled |
|||||
| created_at | timestamptz | 35,6 | null |
|
|
||||||
| expires_at | timestamptz | 35,6 | null |
|
|
Срок действия запроса |
|||||
| accepted_at | timestamptz | 35,6 | √ | null |
|
|
Когда принято |
||||
| declined_at | timestamptz | 35,6 | √ | null |
|
|
Когда отклонено |
||||
| cancelled_at | timestamptz | 35,6 | √ | null |
|
|
Когда отменено |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| ownership_transfer_requests_pkey | Primary key | Asc | id |
| ix_ownership_transfer_expires | Performance | Asc | expires_at |
| ix_ownership_transfer_from_user_id | Performance | Asc | from_user_id |
| ix_ownership_transfer_status | Performance | Asc | status |
| ix_ownership_transfer_team_id | Performance | Asc | team_id |
| ix_ownership_transfer_team_status | Must be unique | Asc/Asc | team_id + status |
| ix_ownership_transfer_to_user_email | Performance | Asc | to_user_email |
| ix_ownership_transfer_to_user_id | Performance | Asc | to_user_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| chk_ownership_transfer_status | ((status)::text = ANY ((ARRAY['pending'::character varying, 'accepted'::character varying, 'declined'::character varying, 'expired'::character varying, 'cancelled'::character varying])::text[])) |
| chk_ownership_transfer_expires | (expires_at > created_at) |

