occurrence

-1 rows


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 null
movement.occurrence_id fk_tap_movement_occurrence R
version int4 10 null
person_identifier varchar 10 null
person_summary.person_identifier fk_occurrence_person R
prison_code varchar 6 null
authorisation_id uuid 2147483647 null
status_id uuid 2147483647 null
occurrence_status.id fk_tap_occurrence_status R
absence_type_id uuid 2147483647 null
absence_type.id fk_tap_occurrence_absence_type R
absence_sub_type_id uuid 2147483647 null
absence_sub_type.id fk_tap_occurrence_absence_sub_type R
absence_reason_category_id uuid 2147483647 null
absence_reason_category.id fk_tap_occurrence_absence_reason_category R
absence_reason_id uuid 2147483647 null
absence_reason.id fk_tap_occurrence_absence_reason R
accompanied_by_id uuid 2147483647 null
accompanied_by.id fk_tap_occurrence_accompanied_by R
transport_id uuid 2147483647 null
transport.id fk_tap_occurrence_transport R
start timestamp 29,6 null
end timestamp 29,6 null
location jsonb 2147483647 null
contact_information text 2147483647 null
comments text 2147483647 null
reason_path jsonb 2147483647 null
legacy_id int8 19 null
dps_only bool 1 null

Indexes

Constraint Name Type Sort Column(s)
pk_tap_occurrence Primary key Asc id
idx_tap_occurrence_authorisation_id Performance Asc authorisation_id
idx_tap_occurrence_person_identifier_dps_only Performance Asc/Asc person_identifier + dps_only
idx_tap_occurrence_prison_end Performance Asc/Asc prison_code + end
idx_tap_occurrence_prison_person_start_end Performance Asc/Asc/Asc/Asc prison_code + person_identifier + start + end
idx_tap_occurrence_prison_start_end Performance Asc/Asc/Asc prison_code + start + end
idx_tap_occurrence_status_id_end Performance Asc/Asc status_id + end
uq_tap_occurrence_legacy_id Must be unique Asc legacy_id

Check Constraints

Constraint Name Constraint
occurrence_status_id_not_null1 status_id IS NOT NULL

Relationships