zz_archived_legacy_keyworker_allocation

-1 rows


Description

Records the Key Worker assignment history of offenders on remand or serving custodial sentences held within an establishment.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
offender_keyworker_id bigserial 19 nextval('offender_key_worker_offender_keyworker_id_seq'::regclass)
offender_no varchar 10 null

The Related Offender No

staff_id int8 19 null

The Related Key Worker Staff Id

assigned_date_time timestamp 29,6 null

Assigned Date and Time

active_flag bpchar 1 null

Assignment Active Flag

alloc_type bpchar 1 null

Type of allocation, M for manual, A for auto, P for provisional

user_id varchar 32 null

Assigned by User Id

prison_id varchar 6 null

Prison Id

expiry_date_time timestamp 29,6 null

Expiry Date and Time of Assignment

create_datetime timestamp 29,6 null
create_user_id varchar 32 null
modify_datetime timestamp 29,6 null
modify_user_id varchar 32 null
allocation_reason_id int8 19 null
reference_data.id offender_key_worker_allocation_reason_id_fkey R
deallocation_reason_id int8 19 null
reference_data.id offender_key_worker_deallocation_reason_id_fkey R

Indexes

Constraint Name Type Sort Column(s)
offender_key_worker_pk Primary key Asc offender_keyworker_id
offender_key_worker_ai_idx Performance Asc prison_id
offender_key_worker_on_idx Performance Asc offender_no
offender_key_worker_si_idx Performance Asc staff_id
offender_keyworker_unique Must be unique Asc/Asc/Asc offender_no + staff_id + assigned_date_time

Check Constraints

Constraint Name Constraint
offender_key_worker_c1 ((alloc_type = ANY (ARRAY['A'::bpchar, 'M'::bpchar, 'P'::bpchar])))

Relationships