Columns
Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
record_id | uuid | 2147483647 | null |
|
|
Public primary key for the CSIP and the shared primary key for 1:1 child entities |
||||||||
prison_number | varchar | 10 | null |
|
|
The prison number of the person the CSIP record is for |
||||||||
prison_code_when_recorded | varchar | 6 | √ | null |
|
|
The prison code where the person was resident at the time the CSIP record was created. Maps to OFFENDER_CSIP_REPORTS.AGY_LOC_ID |
|||||||
log_code | varchar | 10 | √ | null |
|
|
User entered identifier for the CSIP record. Usually starts with the prison code. Maps to OFFENDER_CSIP_REPORTS.CSIP_SEQ |
|||||||
version | int4 | 10 | null |
|
|
Supports optimistic locking preventing unnecessary select queries for new entities |
||||||||
legacy_id | int8 | 19 | √ | null |
|
|
The NOMIS OFFENDER_CSIP_REPORTS.CSIP_ID primary key value. Stored to guarantee uniqueness via sync. Not returned by API |
|||||||
status_id | int8 | 19 | null |
|
|
Foreign key to reference data using the ‘STATUS’ domain for the overall CSIP status. Status is calculated in NOMIS and not stored in the database |
Indexes
Constraint Name | Type | Sort | Column(s) |
---|---|---|---|
csip_record_pkey | Primary key | Asc | record_id |
csip_record_legacy_id_key | Must be unique | Asc | legacy_id |
idx_csip_record_prison_number | Performance | Asc | prison_number |
idx_csip_record_prison_number_lower | Performance | ||
idx_csip_record_status_id | Performance | Asc | status_id |