person_summary

-1 rows


Description

Summary data for people with CSIPs. Used to optimise searching and pagination. Domain events cause the summary data to be updated keeping it accurate

Columns

Column Type Size Nulls Auto Default Children Parents Comments
prison_number varchar 10 null
csip_record.prison_number fk_csip_prison_number R
csip_record_audit.prison_number Implied Constraint R
csip_summary.prison_number Implied Constraint R

The prison number of the person the summary data is associated with

first_name varchar 64 null

The first name of the person

last_name varchar 64 null

The last name of the person

status varchar 16 null

The active/inactive in/out status of the person

prison_code varchar 16 null

The code of the prison the person is resident at or TRN/OUT if they are not in prison

cell_location varchar 64 null

The cell location of the person if they are currently in prison or an alternative location reference

version int4 10 null

Supports optimistic locking preventing unnecessary select queries for new entities

restricted_patient bool 1 false

Whether the person is a restricted patient

supporting_prison_code varchar 16 null

The code of the prison a restricted patient is being supported by

Indexes

Constraint Name Type Sort Column(s)
person_summary_pkey Primary key Asc prison_number
idx_person_summary_first_name_lower Performance
idx_person_summary_last_name_lower Performance
idx_person_summary_prison_code Performance Asc prison_code
idx_person_summary_prison_code_lower Performance
idx_person_summary_prison_number_lower Performance
idx_person_summary_prison_person_lower Performance
idx_person_summary_supporting_prison_code Performance Asc supporting_prison_code

Relationships