19 Foreign Key Constraints
| Constraint Name | Child Column | Parent Column | Delete Rule | ||
|---|---|---|---|---|---|
| recorded_event_policy_code_fkey |
|
|
Restrict delete | ||
| recorded_event_type_id_fkey |
|
|
Restrict delete | ||
| prison_configuration_audit_rev_id_fkey |
|
|
Restrict delete | ||
| allocation_audit_rev_id_fkey |
|
|
Restrict delete | ||
| recorded_event_audit_rev_id_fkey |
|
|
Restrict delete | ||
| recorded_event_audit_policy_code_fkey |
|
|
Restrict delete | ||
| key_worker_status_id_fkey |
|
|
Restrict delete | ||
| staff_configuration_policy_code_fkey |
|
|
Restrict delete | ||
| reference_data_policy_id_fkey |
|
|
Restrict delete | ||
| reference_data_policy_policy_code_fkey |
|
|
Restrict delete | ||
| allocation_policy_code_fkey |
|
|
Restrict delete | ||
| allocation_allocation_reason_id_fkey |
|
|
Restrict delete | ||
| allocation_deallocation_reason_id_fkey |
|
|
Restrict delete | ||
| prison_configuration_policy_code_fkey |
|
|
Restrict delete | ||
| fk_prisoner_statistic_policy_code |
|
|
Restrict delete | ||
| fk_prisoner_statistic_id |
|
|
Restrict delete | ||
| staff_configuration_audit_rev_id_fkey |
|
|
Restrict delete | ||
| staff_role_audit_rev_id_fkey |
|
|
Restrict delete | ||
| prison_statistic_policy_code_fkey |
|
|
Restrict delete |
Check Constraints
| Table | Constraint Name | Constraint |
|---|---|---|
| prison_configuration_audit | prison_configuration_audit_has_prisoners_with_high_co_not_null1 | has_prisoners_with_high_complexity_needs_modified IS NOT NULL |
| allocation | ch_allocation_is_active | (NOT ((is_active = true) AND ((deallocated_at IS NOT NULL) OR (deallocated_by IS NOT NULL) OR (deallocation_reason_id IS NOT NULL)))) |
| allocation | ch_allocation_is_not_active | (NOT ((is_active = false) AND ((deallocated_at IS NULL) OR (deallocated_by IS NULL) OR (deallocation_reason_id IS NULL)))) |
| prison_configuration | prison_config_allocation_order_valid | ((allocation_order)::text = ANY ((ARRAY['BY_ALLOCATIONS'::character varying, 'BY_NAME'::character varying])::text[])) |