Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments |
|---|---|---|---|---|---|---|---|---|
| person_identifier | varchar | 2147483647 | null |
|
|
The prison number of the person the case note was for |
||
| case_note_id | uuid | 2147483647 | null |
|
|
The public primary key assigned to the case note before it was deleted |
||
| legacy_id | int8 | 19 | √ | null |
|
|
The numerical id assigned to the case note before it was deleted |
|
| case_note | jsonb | 2147483647 | null |
|
|
The original data of the deleted case note serialised to JSON |
||
| deleted_at | timestamp | 29,6 | null |
|
|
The date and time the case note was deleted |
||
| deleted_by | varchar | 64 | null |
|
|
The username of the user who deleted the case note |
||
| caseload_id | varchar | 12 | √ | null |
|
|
The active caseload of the user when the case note was deleted |
|
| system | varchar | 6 | null |
|
|
The system used to delete the case note. Either DPS or NOMIS |
||
| cause | varchar | 6 | null |
|
|
What caused the case note to be deleted. A merge, admin level update from NOMIS or an explicit delete request |
||
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
Internal primary key |
||
| reason | text | 2147483647 | √ | null |
|
|
Intended to capture a user entered reason for editing or deleting the case note |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| case_note_deleted_pkey | Primary key | Asc | id |
| case_note_deleted_case_note_id | Performance | Asc | caseload_id |
| case_note_deleted_cause | Performance | Asc | cause |
| case_note_deleted_legacy_id | Performance | Asc | legacy_id |
| case_note_deleted_person_identifier | Performance | Asc | person_identifier |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| check_source | ((system)::text = ANY ((ARRAY['DPS'::character varying, 'NOMIS'::character varying])::text[])) |
| check_cause | ((cause)::text = ANY ((ARRAY['DELETE'::character varying, 'UPDATE'::character varying, 'MERGE'::character varying, 'MOVE'::character varying])::text[])) |