63 Foreign Key Constraints
Constraint Name | Child Column | Parent Column | Delete Rule | ||
---|---|---|---|---|---|
organization_managed_location_types_organization_id_fkey |
|
|
Cascade on delete | ||
organization_managed_location_typ_managed_location_type_id_fkey |
|
|
Restrict delete | ||
notification_types_notification_criticality_id_fkey |
|
|
Restrict delete | ||
user_preferences_user_id_fkey |
|
|
Restrict delete | ||
user_preferences_organization_id_fkey |
|
|
Cascade on delete | ||
organization_report_settings_organization_id_fkey |
|
|
Cascade on delete | ||
project_report_settings_project_id_fkey |
|
|
Cascade on delete | ||
project_land_use_model_types_land_use_model_type_id_fkey |
|
|
Restrict delete | ||
project_land_use_model_types_project_id_fkey |
|
|
Cascade on delete | ||
reports_status_id_fkey |
|
|
Restrict delete | ||
reports_organization_id_fkey |
|
|
Restrict delete | ||
reports_project_id_fkey |
|
|
Null on delete | ||
reports_locked_by_fkey |
|
|
Restrict delete | ||
reports_submitted_by_fkey |
|
|
Restrict delete | ||
reports_modified_by_fkey |
|
|
Restrict delete | ||
organizations_organization_type_id_fkey |
|
|
Restrict delete | ||
organizations_created_by_fkey |
|
|
Restrict delete | ||
organizations_country_code_fkey |
|
|
Restrict delete | ||
organizations_country_subdivision_code_fkey |
|
|
Restrict delete | ||
organizations_modified_by_fkey |
|
|
Restrict delete | ||
notifications_organization_id_fkey |
|
|
Cascade on delete | ||
notifications_notification_type_id_fkey |
|
|
Restrict delete | ||
notifications_user_id_fkey |
|
|
Restrict delete | ||
organization_users_organization_id_fkey |
|
|
Cascade on delete | ||
organization_users_modified_by_fkey |
|
|
Restrict delete | ||
organization_users_created_by_fkey |
|
|
Restrict delete | ||
organization_users_user_id_fkey |
|
|
Restrict delete | ||
organization_users_role_id_fkey |
|
|
Restrict delete | ||
countries_region_id_fkey |
|
|
Restrict delete | ||
projects_country_code_fkey |
|
|
Restrict delete | ||
projects_created_by_fkey |
|
|
|||
projects_organization_id_fkey |
|
|
Restrict delete | ||
projects_modified_by_fkey |
|
|
|||
facilities_modified_by_fkey |
|
|
Restrict delete | ||
site_module_type_id_fkey |
|
|
Restrict delete | ||
facilities_created_by_fkey |
|
|
Restrict delete | ||
facilities_connection_state_id_fkey |
|
|
Restrict delete | ||
facilities_organization_id_fkey |
|
|
Cascade on delete | ||
device_managers_facility_id_fkey |
|
|
Restrict delete | ||
device_managers_user_id_fkey |
|
|
Restrict delete | ||
photos_modified_by_fkey |
|
|
Restrict delete | ||
photos_user_id_fkey |
|
|
Restrict delete | ||
report_files_file_id_fkey |
|
|
Cascade on delete | ||
report_files_report_id_fkey |
|
|
Restrict delete | ||
report_photos_report_id_fkey |
|
|
Restrict delete | ||
report_photos_photo_id_fkey |
|
|
Cascade on delete | ||
country_subdivisions_country_code_fkey |
|
|
Restrict delete | ||
user_global_roles_global_role_id_fkey |
|
|
Cascade on delete | ||
user_global_roles_user_id_fkey |
|
|
Cascade on delete | ||
upload_problems_type_id_fkey |
|
|
Restrict delete | ||
upload_problems_upload_id_fkey |
|
|
Cascade on delete | ||
internal_tags_modified_by_fkey |
|
|
Restrict delete | ||
internal_tags_created_by_fkey |
|
|
Restrict delete | ||
uploads_facility_id_fkey |
|
|
Restrict delete | ||
uploads_status_id_fkey |
|
|
Restrict delete | ||
uploads_organization_id_fkey |
|
|
Restrict delete | ||
uploads_type_id_fkey |
|
|
Restrict delete | ||
uploads_created_by_fkey |
|
|
Restrict delete | ||
users_country_code_fkey |
|
|
Restrict delete | ||
users_user_type_id_fkey |
|
|
Restrict delete | ||
organization_internal_tags_created_by_fkey |
|
|
Restrict delete | ||
organization_internal_tags_organization_id_fkey |
|
|
Cascade on delete | ||
organization_internal_tags_internal_tag_id_fkey |
|
|
Cascade on delete |
Check Constraints
Table | Constraint Name | Constraint |
---|---|---|
reports | cannot_submit_while_locked | (((locked_time IS NULL) OR (submitted_time IS NULL))) |
reports | locked_by_and_time_both_set | ((((locked_by IS NULL) AND (locked_time IS NULL)) OR ((locked_by IS NOT NULL) AND (locked_time IS NOT NULL)))) |
reports | quarter_in_range | (((quarter >= 1) AND (quarter <= 4))) |
reports | status_reflects_locked | ((((locked_by IS NULL) AND (status_id <> 3)) OR ((locked_by IS NOT NULL) AND (status_id = 3)))) |
reports | status_reflects_submitted | ((((submitted_by IS NULL) AND (status_id <> 4)) OR ((submitted_by IS NOT NULL) AND (status_id = 4)))) |
reports | submitted_by_and_time_both_set | ((((submitted_by IS NULL) AND (submitted_time IS NULL)) OR ((submitted_by IS NOT NULL) AND (submitted_time IS NOT NULL)))) |
organizations | country_code_matches_subdivision | (((country_subdivision_code IS NULL) OR (substr(country_subdivision_code, 1, 2) = country_code))) |
organizations | organizations_country_code_check | ((country_code !~ similar_to_escape(' *'::text))) |
organizations | organizations_country_subdivision_code_check | ((country_subdivision_code !~ similar_to_escape(' *'::text))) |
organizations | organizations_description_check | ((description !~ similar_to_escape(' *'::text))) |
organizations | other_type_details_null_or_not_empty | (((organization_type_details IS NULL) OR ((organization_type_details)::text <> ''::text))) |
organizations | other_type_details_only_for_other | ((((organization_type_details IS NULL) AND (organization_type_id <> 6)) OR ((organization_type_details IS NOT NULL) AND (organization_type_id = 6)))) |
countries | countries_code_caps | ((code = upper(code))) |
countries | countries_code_length | ((length(code) = 2)) |
facilities | facilities_description_check | ((description !~ similar_to_escape(' *'::text))) |
device_managers | device_managers_user_iff_facility | ((((user_id IS NOT NULL) AND (facility_id IS NOT NULL)) OR ((user_id IS NULL) AND (facility_id IS NULL)))) |
files | content_type_cannot_be_empty_string | ((length(content_type) > 0)) |
files | file_name_cannot_be_empty_string | ((length(file_name) > 0)) |
country_subdivisions | country_subdivisions_code_length | (((length(code) >= 4) AND (length(code) <= 6))) |
country_subdivisions | country_subdivisions_code_matches_country | ((substr(code, 1, 2) = country_code)) |
upload_problems | upload_problems_field_check | ((field !~ similar_to_escape(' *'::text))) |
upload_problems | upload_problems_message_check | ((message !~ similar_to_escape(' *'::text))) |
upload_problems | upload_problems_value_check | ((value !~ similar_to_escape(' *'::text))) |
users | users_auth_id_check | ((auth_id !~ similar_to_escape(' *'::text))) |
users | users_first_name_check | ((first_name !~ similar_to_escape(' *'::text))) |
users | users_last_name_check | ((last_name !~ similar_to_escape(' *'::text))) |