Constraints

91 Foreign Key Constraints

Constraint Name Child Column Parent Column Delete Rule
variable_section_default_values_variable_type_id_fkey
variable_section_default_values.variable_type_id
variable_types.id
Restrict delete
variable_section_default_valu_variable_id_variable_type_id_fkey
variable_section_default_values.variable_id
variable_section_default_values.variable_type_id
variables.id
variables.variable_type_id
Restrict delete
variable_section_default_values_variable_manifest_id_fkey
variable_section_default_values.variable_manifest_id
variable_manifests.id
Cascade on delete
variable_section_default_values_used_variable_type_id_fkey
variable_section_default_values.used_variable_type_id
variable_types.id
Restrict delete
variable_section_default_values_usage_type_id_fkey
variable_section_default_values.usage_type_id
variable_usage_types.id
Restrict delete
variable_section_default_values_display_style_id_fkey
variable_section_default_values.display_style_id
variable_injection_display_styles.id
Restrict delete
variable_section_default_valu_used_variable_id_used_variab_fkey
variable_section_default_values.used_variable_id
variable_section_default_values.used_variable_type_id
variables.id
variables.variable_type_id
Restrict delete
variable_section_default_values_used_variable_id_fkey
variable_section_default_values.used_variable_id
variables.id
Cascade on delete
variable_section_default_values_variable_id_fkey
variable_section_default_values.variable_id
variables.id
Cascade on delete
variable_link_values_variable_value_id_variable_id_variabl_fkey
variable_link_values.variable_value_id
variable_link_values.variable_id
variable_link_values.variable_type_id
variable_values.id
variable_values.variable_id
variable_values.variable_type_id
Restrict delete
variable_link_values_variable_value_id_fkey
variable_link_values.variable_value_id
variable_values.id
Cascade on delete
variable_link_values_variable_type_id_fkey
variable_link_values.variable_type_id
variable_types.id
Restrict delete
variable_link_values_variable_id_fkey
variable_link_values.variable_id
variables.id
Restrict delete
documents_project_id_fkey
documents.project_id
projects.id
Restrict delete
documents_variable_manifest_id_fkey
documents.variable_manifest_id
variable_manifests.id
Restrict delete
documents_document_template_id_fkey
documents.document_template_id
document_templates.id
Restrict delete
documents_owned_by_fkey
documents.owned_by
users.id
documents_modified_by_fkey
documents.modified_by
users.id
documents_created_by_fkey
documents.created_by
users.id
documents_status_id_fkey
documents.status_id
document_statuses.id
Restrict delete
variable_workflow_history_created_by_fkey
variable_workflow_history.created_by
users.id
Restrict delete
variable_workflow_history_variable_workflow_status_id_fkey
variable_workflow_history.variable_workflow_status_id
variable_workflow_statuses.id
Restrict delete
variable_workflow_history_max_variable_value_id_fkey
variable_workflow_history.max_variable_value_id
variable_values.id
Restrict delete
variable_workflow_history_project_id_fkey
variable_workflow_history.project_id
projects.id
Cascade on delete
variable_workflow_history_variable_id_fkey
variable_workflow_history.variable_id
variables.id
Restrict delete
variable_section_recommendations_recommended_variable_id_fkey
variable_section_recommendations.recommended_variable_id
variables.id
Cascade on delete
variable_section_recommendations_section_variable_type_id_fkey
variable_section_recommendations.section_variable_type_id
variable_types.id
Restrict delete
variable_section_recommendations_variable_manifest_id_fkey
variable_section_recommendations.variable_manifest_id
variable_manifests.id
Cascade on delete
variable_section_recommendations_section_variable_id_fkey
variable_section_recommendations.section_variable_id
variables.id
Cascade on delete
variable_image_values_file_id_fkey
variable_image_values.file_id
files.id
Restrict delete
variable_image_values_variable_value_id_fkey
variable_image_values.variable_value_id
variable_values.id
Cascade on delete
variable_image_values_variable_type_id_fkey
variable_image_values.variable_type_id
variable_types.id
Restrict delete
variable_image_values_variable_value_id_variable_id_variab_fkey
variable_image_values.variable_value_id
variable_image_values.variable_id
variable_image_values.variable_type_id
variable_values.id
variable_values.variable_id
variable_values.variable_type_id
Restrict delete
variable_image_values_variable_id_fkey
variable_image_values.variable_id
variables.id
Restrict delete
variable_values_project_id_fkey
variable_values.project_id
projects.id
Cascade on delete
variable_values_variable_id_variable_type_id_fkey
variable_values.variable_id
variable_values.variable_type_id
variables.id
variables.variable_type_id
Restrict delete
variable_values_variable_type_id_fkey
variable_values.variable_type_id
variable_types.id
Restrict delete
variable_values_created_by_fkey
variable_values.created_by
users.id
variable_values_variable_id_fkey
variable_values.variable_id
variables.id
Restrict delete
variable_owners_project_id_fkey
variable_owners.project_id
projects.id
Cascade on delete
variable_owners_variable_id_fkey
variable_owners.variable_id
variables.id
Restrict delete
variable_owners_owned_by_fkey
variable_owners.owned_by
users.id
Cascade on delete
document_saved_versions_created_by_fkey
document_saved_versions.created_by
users.id
document_saved_versions_document_id_fkey
document_saved_versions.document_id
documents.id
Cascade on delete
document_saved_versions_variable_manifest_id_fkey
document_saved_versions.variable_manifest_id
variable_manifests.id
Restrict delete
variable_section_values_used_variable_type_id_fkey
variable_section_values.used_variable_type_id
variable_types.id
Restrict delete
variable_section_values_variable_type_id_fkey
variable_section_values.variable_type_id
variable_types.id
Restrict delete
variable_section_values_used_variable_id_fkey
variable_section_values.used_variable_id
variables.id
Restrict delete
variable_section_values_usage_type_id_fkey
variable_section_values.usage_type_id
variable_usage_types.id
Restrict delete
variable_section_values_used_variable_id_used_variable_typ_fkey
variable_section_values.used_variable_id
variable_section_values.used_variable_type_id
variables.id
variables.variable_type_id
Restrict delete
variable_section_values_variable_value_id_variable_id_vari_fkey
variable_section_values.variable_value_id
variable_section_values.variable_id
variable_section_values.variable_type_id
variable_values.id
variable_values.variable_id
variable_values.variable_type_id
Restrict delete
variable_section_values_display_style_id_fkey
variable_section_values.display_style_id
variable_injection_display_styles.id
Restrict delete
variable_section_values_variable_value_id_fkey
variable_section_values.variable_value_id
variable_values.id
Cascade on delete
variable_section_values_variable_id_fkey
variable_section_values.variable_id
variables.id
Restrict delete
variable_manifests_document_template_id_fkey
variable_manifests.document_template_id
document_templates.id
Restrict delete
variable_manifests_created_by_fkey
variable_manifests.created_by
users.id
variable_select_option_values_option_id_fkey
variable_select_option_values.option_id
variable_select_options.id
Restrict delete
variable_select_option_values_variable_type_id_fkey
variable_select_option_values.variable_type_id
variable_types.id
Restrict delete
variable_select_option_values_option_id_variable_id_fkey
variable_select_option_values.option_id
variable_select_option_values.variable_id
variable_select_options.id
variable_select_options.variable_id
Restrict delete
variable_select_option_values_variable_value_id_fkey
variable_select_option_values.variable_value_id
variable_values.id
Cascade on delete
variable_select_option_values_variable_value_id_variable_i_fkey
variable_select_option_values.variable_value_id
variable_select_option_values.variable_id
variable_select_option_values.variable_type_id
variable_values.id
variable_values.variable_id
variable_values.variable_type_id
Restrict delete
variable_select_option_values_variable_id_fkey
variable_select_option_values.variable_id
variable_selects.variable_id
Restrict delete
variable_manifest_entries_variable_manifest_id_fkey
variable_manifest_entries.variable_manifest_id
variable_manifests.id
Restrict delete
variable_manifest_entries_variable_id_fkey
variable_manifest_entries.variable_id
variables.id
Restrict delete
variable_table_columns_table_variable_type_id_fkey
variable_table_columns.table_variable_type_id
variable_types.id
Restrict delete
variable_table_columns_table_variable_id_table_variable_ty_fkey
variable_table_columns.table_variable_id
variable_table_columns.table_variable_type_id
variable_tables.variable_id
variable_tables.variable_type_id
Cascade on delete
variable_table_columns_table_variable_id_fkey
variable_table_columns.table_variable_id
variables.id
Restrict delete
variable_table_columns_variable_id_fkey
variable_table_columns.variable_id
variables.id
Restrict delete
variable_selects_variable_id_variable_type_id_fkey
variable_selects.variable_id
variable_selects.variable_type_id
variables.id
variables.variable_type_id
Cascade on delete
variable_selects_variable_type_id_fkey
variable_selects.variable_type_id
variable_types.id
Restrict delete
variable_select_options_variable_id_variable_type_id_fkey
variable_select_options.variable_id
variable_select_options.variable_type_id
variable_selects.variable_id
variable_selects.variable_type_id
Cascade on delete
variable_select_options_variable_id_fkey
variable_select_options.variable_id
variables.id
Cascade on delete
variable_select_options_variable_type_id_fkey
variable_select_options.variable_type_id
variable_types.id
Restrict delete
variable_value_table_rows_variable_value_id_fkey
variable_value_table_rows.variable_value_id
variable_values.id
Cascade on delete
variable_value_table_rows_table_row_value_id_fkey
variable_value_table_rows.table_row_value_id
variable_values.id
Cascade on delete
variable_tables_table_style_id_fkey
variable_tables.table_style_id
variable_table_styles.id
Restrict delete
variable_tables_variable_id_variable_type_id_fkey
variable_tables.variable_id
variable_tables.variable_type_id
variables.id
variables.variable_type_id
Cascade on delete
variable_tables_variable_type_id_fkey
variable_tables.variable_type_id
variable_types.id
Restrict delete
variable_numbers_variable_id_fkey
variable_numbers.variable_id
variables.id
Cascade on delete
variable_numbers_variable_id_variable_type_id_fkey
variable_numbers.variable_id
variable_numbers.variable_type_id
variables.id
variables.variable_type_id
Restrict delete
variable_numbers_variable_type_id_fkey
variable_numbers.variable_type_id
variable_types.id
Restrict delete
variable_texts_variable_id_variable_type_id_fkey
variable_texts.variable_id
variable_texts.variable_type_id
variables.id
variables.variable_type_id
Cascade on delete
variable_texts_variable_type_id_fkey
variable_texts.variable_type_id
variable_types.id
Restrict delete
variable_texts_variable_text_type_id_fkey
variable_texts.variable_text_type_id
variable_text_types.id
Restrict delete
variables_dependency_condition_id_fkey
variables.dependency_condition_id
dependency_conditions.id
Restrict delete
variables_replaces_variable_id_fkey
variables.replaces_variable_id
variables.id
Null on delete
variables_variable_type_id_fkey
variables.variable_type_id
variable_types.id
Restrict delete
variable_sections_variable_id_variable_type_id_fkey
variable_sections.variable_id
variable_sections.variable_type_id
variables.id
variables.variable_type_id
Cascade on delete
variable_sections_variable_type_id_fkey
variable_sections.variable_type_id
variable_types.id
Restrict delete
variable_sections_parent_variable_id_parent_variable_type__fkey
variable_sections.parent_variable_id
variable_sections.parent_variable_type_id
variables.id
variables.variable_type_id
Cascade on delete
variable_sections_parent_variable_type_id_fkey
variable_sections.parent_variable_type_id
variable_types.id
Restrict delete

Check Constraints

Table Constraint Name Constraint
variable_section_default_values cannot_have_both_text_and_reference (((text_value IS NULL) OR (used_variable_id IS NULL)))
variable_section_default_values cannot_reference_other_sections (((used_variable_type_id IS NULL) OR (used_variable_type_id <> 8)))
variable_section_default_values must_have_text_or_reference (((text_value IS NOT NULL) OR (used_variable_id IS NOT NULL)))
variable_section_default_values variable_section_default_values_variable_type_id_check ((variable_type_id = 8))
variable_link_values variable_link_values_variable_type_id_check ((variable_type_id = 7))
variable_section_recommendations variable_section_recommendations_section_variable_type_id_check ((section_variable_type_id = 8))
variable_image_values variable_image_values_variable_type_id_check ((variable_type_id = 4))
variable_values variable_values_check (((number_value IS NULL) OR (variable_type_id = 1)))
variable_values variable_values_check1 (((text_value IS NULL) OR (variable_type_id = 2)))
variable_section_values cannot_have_both_text_and_reference (((text_value IS NULL) OR (used_variable_id IS NULL)))
variable_section_values cannot_inject_sections ((NOT ((usage_type_id = 1) AND (used_variable_type_id = 8))))
variable_section_values cannot_reference_other_sections (((used_variable_type_id IS NULL) OR (used_variable_type_id <> 8)))
variable_section_values injection_has_display_style (((usage_type_id = 1) = (display_style_id IS NOT NULL)))
variable_section_values must_have_text_or_reference (((text_value IS NOT NULL) OR (used_variable_id IS NOT NULL)))
variable_section_values reference_only_for_figures_and_sections (((usage_type_id <> 2) OR (used_variable_type_id = ANY (ARRAY[4, 6, 8]))))
variable_section_values usages_must_have_types (((used_variable_id IS NULL) = (usage_type_id IS NULL)))
variable_select_option_values variable_select_option_values_variable_type_id_check ((variable_type_id = 5))
variable_table_columns variable_table_columns_table_variable_type_id_check ((table_variable_type_id = 6))
variable_selects variable_selects_variable_type_id_check ((variable_type_id = 5))
variable_tables variable_tables_variable_type_id_check ((variable_type_id = 6))
variable_numbers variable_numbers_variable_type_id_check ((variable_type_id = 1))
variable_texts variable_texts_variable_type_id_check ((variable_type_id = 2))
variable_sections variable_sections_parent_variable_type_id_check (((parent_variable_type_id IS NULL) OR (parent_variable_type_id = 8)))
variable_sections variable_sections_variable_type_id_check ((variable_type_id = 8))