Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| stay_verification_id | uuid | 2147483647 | null |
|
|
|||||||||
| company_id | uuid | 2147483647 | null |
|
|
|||||||||
| worker_id | uuid | 2147483647 | null |
|
|
|||||||||
| source_stay_expiry_date | date | 13 | null |
|
|
|||||||||
| verification_status | varchar | 30 | null |
|
|
|||||||||
| status_checked_at | timestamptz | 35,6 | √ | null |
|
|
||||||||
| extension_applied_at | date | 13 | √ | null |
|
|
||||||||
| extension_receipt_document_id | uuid | 2147483647 | √ | null |
|
|
||||||||
| approval_result_document_id | uuid | 2147483647 | √ | null |
|
|
||||||||
| new_stay_expiry_date | date | 13 | √ | null |
|
|
||||||||
| official_consultation_note | varchar | 1000 | √ | null |
|
|
||||||||
| employment_end_confirmed_at | timestamptz | 35,6 | √ | null |
|
|
||||||||
| recheck_date | date | 13 | √ | null |
|
|
||||||||
| created_at | timestamptz | 35,6 | null |
|
|
|||||||||
| updated_at | timestamptz | 35,6 | null |
|
|
|||||||||
| version | int8 | 19 | 0 |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| pk_stay_verification_case | Primary key | Asc | stay_verification_id |
| idx_stay_verification_company_status | Performance | Asc/Asc/Desc | company_id + verification_status + updated_at |
| idx_stay_verification_company_worker | Performance | Asc/Asc/Desc | company_id + worker_id + created_at |
| uq_stay_verification_worker_expiry | Must be unique | Asc/Asc/Asc | company_id + worker_id + source_stay_expiry_date |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| ck_stay_verification_status | (((verification_status)::text = ANY ((ARRAY['APPROVED'::character varying, 'APPLICATION_PENDING'::character varying, 'UNKNOWN'::character varying, 'NOT_APPLIED'::character varying, 'EMPLOYMENT_ENDED'::character varying])::text[]))) |
| ck_stay_verification_version | ((version >= 0)) |
| ck_stay_verification_new_expiry | (((new_stay_expiry_date IS NULL) OR (new_stay_expiry_date > source_stay_expiry_date))) |
| ck_stay_verification_note | (((official_consultation_note IS NULL) OR (char_length(TRIM(BOTH FROM official_consultation_note)) > 0))) |
| ck_stay_verification_updated_at | ((updated_at >= created_at)) |

