Constraints

49 Foreign Key Constraints

Constraint Name Child Column Parent Column Delete Rule
recreation_activity_code_trails_rec_resource_id_fkey
recreation_activity_code_trails.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_activity_code_trails_recreation_activity_code_fkey
recreation_activity_code_trails.recreation_activity_code
recreation_activity_code.recreation_activity_code
Restrict delete
recreation_spatial_submission_recreation_resource_type_fkey
recreation_spatial_submission.recreation_resource_type
recreation_resource_type_code.rec_resource_type_code
Restrict delete
recreation_spatial_submission_tenure_id_fkey
recreation_spatial_submission.tenure_id
recreation_resource.rec_resource_id
Restrict delete
recreation_defined_campsite_rec_resource_id_fkey
recreation_defined_campsite.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_defined_campsite_recreation_remed_repair_code_fkey
recreation_defined_campsite.recreation_remed_repair_code
recreation_remed_repair_code.recreation_remed_repair_code
Restrict delete
recreation_resource_risk_rating_code_fkey
recreation_resource.risk_rating_code
recreation_risk_rating_code.risk_rating_code
Restrict delete
recreation_resource_district_code_fkey
recreation_resource.district_code
recreation_district_code.district_code
Restrict delete
recreation_resource_maintenance_standard_code_fkey
recreation_resource.maintenance_standard_code
recreation_maintenance_standard_code.maintenance_standard_code
Restrict delete
recreation_resource_control_access_code_fkey
recreation_resource.control_access_code
recreation_control_access_code.recreation_control_access_code
Restrict delete
act_advisories_flat_rec_resource_id_fkey
act_advisories_flat.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_access_sub_access_code_fkey
recreation_access.sub_access_code
recreation_sub_access_code.sub_access_code
Restrict delete
recreation_access_rec_resource_id_fkey
recreation_access.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_access_access_code_fkey
recreation_access.access_code
recreation_access_code.access_code
Restrict delete
recreation_resource_document_rec_resource_id_fkey
recreation_resource_document.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_resource_document_doc_code_fkey
recreation_resource_document.doc_code
recreation_resource_doc_code.doc_code
Restrict delete
fk_repair_asset
recreation_asset_repair.asset_id
recreation_asset.asset_id
Cascade on delete
fk_repair_remed_code
recreation_asset_repair.recreation_remed_repair_code
recreation_remed_repair_code.recreation_remed_repair_code
Restrict delete
recreation_map_feature_geom_rmf_skey_fkey
recreation_map_feature_geom.rmf_skey
recreation_map_feature.rmf_skey
Restrict delete
recreation_resource_reservation_info_rec_resource_id_fkey
recreation_resource_reservation_info.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
fk_recreation_exhibit_a_doc_submission_id
recreation_exhibit_a_doc.submission_id
recreation_spatial_submission.submission_id
Restrict delete
recreation_exhibit_a_doc_rec_resource_id_fkey
recreation_exhibit_a_doc.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_resource_image_rec_resource_id_fkey
recreation_resource_image.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
fk_asset_rec_resource
recreation_asset.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
fk_asset_asset_code
recreation_asset.asset_code
recreation_asset_code.asset_code
Restrict delete
fk_asset_parent
recreation_asset.parent_id
recreation_asset.asset_id
Restrict delete
recreation_agreement_holder_rec_resource_id_fkey
recreation_agreement_holder.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_status_status_code_fkey
recreation_status.status_code
recreation_status_code.status_code
Restrict delete
recreation_status_rec_resource_id_fkey
recreation_status.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_structure_rec_resource_id_fkey
recreation_structure.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_structure_structure_code_fkey
recreation_structure.structure_code
recreation_structure_code.structure_code
Restrict delete
fk_asset_geom_asset
recreation_asset_geom.asset_id
recreation_asset.asset_id
Cascade on delete
recreation_site_description_rec_resource_id_fkey
recreation_site_description.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_fee_sub_code_recreation_fee_code_fkey
recreation_fee_sub_code.recreation_fee_code
recreation_fee_code.recreation_fee_code
Restrict delete
recreation_driving_direction_rec_resource_id_fkey
recreation_driving_direction.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_feature_rec_resource_id_fkey
recreation_feature.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_feature_recreation_feature_code_fkey
recreation_feature.recreation_feature_code
recreation_feature_code.recreation_feature_code
Restrict delete
recreation_fee_rec_resource_id_fkey
recreation_fee.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_fee_sub_code_fk
recreation_fee.recreation_fee_code
recreation_fee.recreation_fee_sub_code
recreation_fee_sub_code.recreation_fee_code
recreation_fee_sub_code.recreation_fee_sub_code
Restrict delete
recreation_fee_recreation_fee_code_fkey
recreation_fee.recreation_fee_code
recreation_fee_code.recreation_fee_code
Restrict delete
recreation_image_consent_form_image_id_fkey
recreation_image_consent_form.image_id
recreation_resource_image.image_id
Restrict delete
recreation_image_consent_form_photographer_type_code_fkey
recreation_image_consent_form.photographer_type_code
recreation_photographer_type_code.photographer_type_code
Restrict delete
recreation_image_consent_form_doc_id_fkey
recreation_image_consent_form.doc_id
recreation_resource_document.doc_id
Restrict delete
recreation_establishment_order_docs_rec_resource_id_fkey
recreation_establishment_order_docs.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_map_feature_recreation_resource_type_fkey
recreation_map_feature.recreation_resource_type
recreation_resource_type_code.rec_resource_type_code
Restrict delete
recreation_map_feature_rec_resource_id_fkey
recreation_map_feature.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_activity_rec_resource_id_fkey
recreation_activity.rec_resource_id
recreation_resource.rec_resource_id
Restrict delete
recreation_activity_recreation_activity_code_fkey
recreation_activity.recreation_activity_code
recreation_activity_code.recreation_activity_code
Restrict delete
recreation_fee_fdl_log_fee_id_fkey
recreation_fee_fdl_log.fee_id
recreation_fee.fee_id
Restrict delete

Check Constraints

Table Constraint Name Constraint
recreation_spatial_submission chk_spatial_submission_adjudication (((adjudication_ind = true) AND ((status)::text = ANY ((ARRAY['APP'::character varying, 'REJ'::character varying])::text[])) AND (adjudicated_by IS NOT NULL) AND (adjudication_date IS NOT NULL)) OR ((adjudication_ind = false) AND ((status)::text = ANY ((ARRAY['PND'::character varying, 'CLR'::character varying, 'FAI'::character varying])::text[])) AND (adjudicated_by IS NULL) AND (adjudication_date IS NULL)))
recreation_spatial_submission chk_spatial_submission_decision (((decision)::text = ANY ((ARRAY['APPROVE'::character varying, 'REJECT'::character varying])::text[])) OR (decision IS NULL))
recreation_spatial_submission chk_spatial_submission_purpose ((purpose_code)::text = ANY ((ARRAY['N'::character varying, 'A'::character varying, 'R'::character varying])::text[]))
recreation_spatial_submission chk_spatial_submission_status ((status)::text = ANY ((ARRAY['CLR'::character varying, 'APP'::character varying, 'REJ'::character varying, 'PND'::character varying, 'FAI'::character varying])::text[]))
recreation_spatial_submission chk_spatial_submission_status_business_rules ((((status)::text = 'CLR'::text) AND (decision IS NULL) AND (adjudication_comment IS NULL) AND (adjudication_report_document_uri IS NULL)) OR (((status)::text = 'APP'::text) AND ((decision)::text = 'APPROVE'::text) AND (adjudication_report_document_uri IS NOT NULL)) OR (((status)::text = 'REJ'::text) AND ((decision)::text = 'REJECT'::text) AND (adjudication_comment IS NOT NULL)) OR ((status)::text = ANY ((ARRAY['PND'::character varying, 'FAI'::character varying])::text[])))
recreation_spatial_submission chk_spatial_submission_status_request_type ((status_request_type_code)::text = ANY ((ARRAY['RL'::character varying, 'RPO'::character varying])::text[]))
recreation_exhibit_a_doc chk_recreation_exhibit_a_doc_generation_method (((generation_method)::text = ANY ((ARRAY['upload'::character varying, 'regenerate'::character varying, 'migrated from FTA'::character varying])::text[])) OR (generation_method IS NULL))
recreation_exhibit_a_doc chk_recreation_exhibit_a_doc_page_orientation (((page_orientation)::text = ANY ((ARRAY['Portrait'::character varying, 'Landscape'::character varying])::text[])) OR (page_orientation IS NULL))
recreation_exhibit_a_doc chk_recreation_exhibit_a_doc_page_size (((page_size)::text = ANY ((ARRAY['A'::character varying, 'B'::character varying, 'C'::character varying, 'D'::character varying, 'E'::character varying])::text[])) OR (page_size IS NULL))
recreation_asset chk_no_self_parent (parent_id <> asset_id)