Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | null |
|
|
||||||
| version | int4 | 10 | null |
|
|
||||||
| person_identifier | varchar | 10 | null |
|
|
||||||
| prison_code | varchar | 6 | null |
|
|
||||||
| absence_type_id | int8 | 19 | √ | null |
|
|
|||||
| absence_sub_type_id | int8 | 19 | √ | null |
|
|
|||||
| absence_reason_id | int8 | 19 | √ | null |
|
|
|||||
| repeat | bool | 1 | null |
|
|
||||||
| status_id | int8 | 19 | null |
|
|
||||||
| notes | text | 2147483647 | √ | null |
|
|
|||||
| application_date | date | 13 | null |
|
|
||||||
| submitted_at | timestamp | 29,6 | null |
|
|
||||||
| submitted_by | varchar | 64 | null |
|
|
||||||
| approved_at | timestamp | 29,6 | √ | null |
|
|
|||||
| approved_by | varchar | 64 | √ | null |
|
|
|||||
| legacy_id | int8 | 19 | √ | null |
|
|
|||||
| from_date | date | 13 | null |
|
|
||||||
| to_date | date | 13 | null |
|
|
||||||
| schedule | jsonb | 2147483647 | √ | null |
|
|
|||||
| absence_reason_category_id | int8 | 19 | √ | null |
|
|
|||||
| reason_path | jsonb | 2147483647 | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| pk_temporary_absence_authorisation | Primary key | Asc | id |
| idx_taa_prison_code_person_identifier_from_to | Performance | Asc/Asc/Asc/Asc | prison_code + person_identifier + from_date + to_date |
| uq_temporary_absence_authorisation_legacy_id | Must be unique | Asc | legacy_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| ch_taa_approved_at_approved_by | (((approved_at IS NULL) AND (approved_by IS NULL)) OR ((approved_at IS NOT NULL) AND (approved_by IS NOT NULL))) |