102 Foreign Key Constraints
Constraint Name | Child Column | Parent Column | Delete Rule | ||||
---|---|---|---|---|---|---|---|
observation_requested_subzones_observation_id_fkey |
|
|
Cascade on delete | ||||
observation_requested_subzones_planting_subzone_id_fkey |
|
|
Cascade on delete | ||||
planting_site_populations_planting_site_id_fkey |
|
|
Cascade on delete | ||||
planting_site_populations_species_id_fkey |
|
|
Cascade on delete | ||||
planting_subzone_populations_planting_subzone_id_fkey |
|
|
Cascade on delete | ||||
planting_subzone_populations_species_id_fkey |
|
|
Cascade on delete | ||||
observation_plots_status_id_fkey |
|
|
Restrict delete | ||||
observation_plots_modified_by_fkey |
|
|
Restrict delete | ||||
observation_plots_observation_id_fkey |
|
|
Cascade on delete | ||||
observation_plots_completed_by_fkey |
|
|
Restrict delete | ||||
observation_plots_monitoring_plot_history_id_fkey |
|
|
Cascade on delete | ||||
observation_plots_monitoring_plot_id_fkey |
|
|
Cascade on delete | ||||
observation_plots_created_by_fkey |
|
|
Restrict delete | ||||
observation_plots_claimed_by_fkey |
|
|
Restrict delete | ||||
monitoring_plots_modified_by_fkey |
|
|
Restrict delete | ||||
monitoring_plots_created_by_fkey |
|
|
Restrict delete | ||||
monitoring_plots_planting_site_id_fkey |
|
|
Cascade on delete | ||||
monitoring_plots_planting_subzone_id_fkey |
|
|
Cascade on delete | ||||
planting_subzone_histories_planting_subzone_id_fkey |
|
|
Null on delete | ||||
planting_subzone_histories_planting_zone_history_id_fkey |
|
|
Cascade on delete | ||||
plantings_planting_site_id_plot_id_fkey |
|
|
Restrict delete | ||||
plantings_planting_site_id_fkey |
|
|
Cascade on delete | ||||
plantings_planting_subzone_id_fkey |
|
|
Cascade on delete | ||||
plantings_planting_site_id_delivery_id_fkey |
|
|
Restrict delete | ||||
plantings_species_id_fkey |
|
|
Restrict delete | ||||
plantings_delivery_id_fkey |
|
|
Cascade on delete | ||||
plantings_planting_type_id_fkey |
|
|
Restrict delete | ||||
plantings_created_by_fkey |
|
|
Restrict delete | ||||
observed_plot_species_totals_observation_id_fkey |
|
|
Cascade on delete | ||||
observed_plot_species_totals_certainty_id_fkey |
|
|
Restrict delete | ||||
observed_plot_species_totals_monitoring_plot_id_fkey |
|
|
Cascade on delete | ||||
observed_plot_species_totals_species_id_fkey |
|
|
Restrict delete | ||||
planting_seasons_planting_site_id_fkey |
|
|
Cascade on delete | ||||
observed_zone_species_totals_certainty_id_fkey |
|
|
Restrict delete | ||||
observed_zone_species_totals_species_id_fkey |
|
|
Restrict delete | ||||
observed_zone_species_totals_planting_zone_id_fkey |
|
|
Cascade on delete | ||||
observed_zone_species_totals_observation_id_fkey |
|
|
Cascade on delete | ||||
plots_planting_site_id_planting_zone_id_fkey |
|
|
Restrict delete | ||||
plots_created_by_fkey |
|
|
Restrict delete | ||||
plots_planting_zone_id_fkey |
|
|
Cascade on delete | ||||
plots_modified_by_fkey |
|
|
Restrict delete | ||||
plots_planting_site_id_fkey |
|
|
Cascade on delete | ||||
planting_site_histories_created_by_fkey |
|
|
Restrict delete | ||||
planting_site_histories_planting_site_id_fkey |
|
|
Cascade on delete | ||||
monitoring_plot_overlaps_overlaps_plot_id_fkey |
|
|
Cascade on delete | ||||
monitoring_plot_overlaps_monitoring_plot_id_fkey |
|
|
Cascade on delete | ||||
planting_sites_created_by_fkey |
|
|
Restrict delete | ||||
planting_sites_modified_by_fkey |
|
|
Restrict delete | ||||
planting_sites_time_zone_fkey |
|
|
Null on delete | ||||
planting_sites_country_code_fkey |
|
|
Null on delete | ||||
planting_sites_organization_id_fkey |
|
|
Cascade on delete | ||||
planting_sites_project_id_fkey |
|
|
Null on delete | ||||
recorded_plants_observation_id_monitoring_plot_id_fkey |
|
|
Cascade on delete | ||||
recorded_plants_certainty_id_fkey |
|
|
Restrict delete | ||||
recorded_plants_species_id_fkey |
|
|
Restrict delete | ||||
recorded_plants_observation_id_fkey |
|
|
Cascade on delete | ||||
recorded_plants_monitoring_plot_id_fkey |
|
|
Cascade on delete | ||||
recorded_plants_status_id_fkey |
|
|
Restrict delete | ||||
observed_plot_coordinates_observation_id_monitoring_plot_i_fkey |
|
|
Restrict delete | ||||
observed_plot_coordinates_position_id_fkey |
|
|
Restrict delete | ||||
observed_plot_coordinates_observation_id_fkey |
|
|
Cascade on delete | ||||
observed_plot_coordinates_monitoring_plot_id_fkey |
|
|
Cascade on delete | ||||
observations_planting_site_id_fkey |
|
|
Cascade on delete | ||||
observations_state_id_fkey |
|
|
Restrict delete | ||||
observed_site_species_totals_observation_id_fkey |
|
|
Cascade on delete | ||||
observed_site_species_totals_species_id_fkey |
|
|
Restrict delete | ||||
observed_site_species_totals_certainty_id_fkey |
|
|
Restrict delete | ||||
observed_site_species_totals_planting_site_id_fkey |
|
|
Cascade on delete | ||||
planting_site_notifications_notification_type_id_fkey |
|
|
Restrict delete | ||||
planting_site_notifications_planting_site_id_fkey |
|
|
Cascade on delete | ||||
observation_plot_conditions_observation_id_fkey |
|
|
Cascade on delete | ||||
observation_plot_conditions_monitoring_plot_id_fkey |
|
|
Cascade on delete | ||||
observation_plot_conditions_condition_id_fkey |
|
|
Restrict delete | ||||
deliveries_planting_site_id_fkey |
|
|
Cascade on delete | ||||
deliveries_reassigned_by_fkey |
|
|
Restrict delete | ||||
deliveries_created_by_fkey |
|
|
Restrict delete | ||||
deliveries_modified_by_fkey |
|
|
Restrict delete | ||||
deliveries_withdrawal_id_fkey |
|
|
Cascade on delete | ||||
planting_zones_created_by_fkey |
|
|
Restrict delete | ||||
planting_zones_modified_by_fkey |
|
|
Restrict delete | ||||
planting_zones_planting_site_id_fkey |
|
|
Cascade on delete | ||||
observation_photos_observation_id_fkey |
|
|
Restrict delete | ||||
observation_photos_monitoring_plot_id_fkey |
|
|
Restrict delete | ||||
observation_photos_position_id_fkey |
|
|
Restrict delete | ||||
observation_photos_observation_id_monitoring_plot_id_fkey |
|
|
Restrict delete | ||||
observation_photos_file_id_fkey |
|
|
Cascade on delete | ||||
planting_zone_populations_species_id_fkey |
|
|
Cascade on delete | ||||
planting_zone_populations_planting_zone_id_fkey |
|
|
Cascade on delete | ||||
draft_planting_sites_project_id_fkey |
|
|
Null on delete | ||||
draft_planting_sites_time_zone_fkey |
|
|
Restrict delete | ||||
draft_planting_sites_created_by_fkey |
|
|
Restrict delete | ||||
draft_planting_sites_modified_by_fkey |
|
|
Restrict delete | ||||
draft_planting_sites_organization_id_fkey |
|
|
Cascade on delete | ||||
draft_planting_sites_organization_id_project_id_fkey |
|
|
Restrict delete | ||||
planting_zone_histories_planting_zone_id_fkey |
|
|
Null on delete | ||||
planting_zone_histories_planting_site_history_id_fkey |
|
|
Cascade on delete | ||||
monitoring_plot_histories_planting_site_id_fkey |
|
|
Cascade on delete | ||||
monitoring_plot_histories_planting_subzone_history_id_fkey |
|
|
Cascade on delete | ||||
monitoring_plot_histories_created_by_fkey |
|
|
Restrict delete | ||||
monitoring_plot_histories_planting_site_history_id_fkey |
|
|
Cascade on delete | ||||
monitoring_plot_histories_planting_subzone_id_fkey |
|
|
Null on delete | ||||
monitoring_plot_histories_monitoring_plot_id_fkey |
|
|
Cascade on delete |
Check Constraints
Table | Constraint Name | Constraint |
---|---|---|
observation_plots | cannot_unclaim_completed_plot | (((completed_by IS NULL) OR ((completed_by IS NOT NULL) AND (claimed_by IS NOT NULL)))) |
monitoring_plots | cluster_has_subplot | ((((permanent_cluster IS NOT NULL) AND (permanent_cluster_subplot IS NOT NULL)) OR ((permanent_cluster IS NULL) AND (permanent_cluster_subplot IS NULL)))) |
monitoring_plots | subplot_is_valid | (((permanent_cluster_subplot >= 1) AND (permanent_cluster_subplot <= 4))) |
plantings | num_plants_sign_consistent_with_type | ((((planting_type_id = ANY (ARRAY[2, 4])) AND (num_plants < 0)) OR ((planting_type_id <> ALL (ARRAY[2, 4])) AND (num_plants > 0)))) |
plantings | plantings_notes_check | ((notes !~ similar_to_escape(' *'::text))) |
observed_plot_species_totals | species_identifier_for_certainty | ((((certainty_id = 1) AND (species_id IS NOT NULL) AND (species_name IS NULL)) OR ((certainty_id = 2) AND (species_id IS NULL) AND (species_name IS NOT NULL)) OR ((certainty_id = 3) AND (species_id IS NULL) AND (species_name IS NULL)))) |
planting_seasons | planting_seasons_check | ((start_date < end_date)) |
planting_seasons | planting_seasons_check1 | ((start_time < end_time)) |
observed_zone_species_totals | species_identifier_for_certainty | ((((certainty_id = 1) AND (species_id IS NOT NULL) AND (species_name IS NULL)) OR ((certainty_id = 2) AND (species_id IS NULL) AND (species_name IS NOT NULL)) OR ((certainty_id = 3) AND (species_id IS NULL) AND (species_name IS NULL)))) |
planting_subzones | area_positive | ((area_ha > (0)::numeric)) |
monitoring_plot_overlaps | newer_overlaps_older | ((overlaps_plot_id < monitoring_plot_id)) |
planting_sites | area_positive | ((area_ha > (0)::numeric)) |
planting_sites | planting_sites_description_check | ((description !~ similar_to_escape(' *'::text))) |
recorded_plants | species_info_matches_certainty | ((((certainty_id = 1) AND (species_id IS NOT NULL) AND (species_name IS NULL)) OR ((certainty_id = 2) AND (species_id IS NULL)) OR ((certainty_id = 3) AND (species_id IS NULL) AND (species_name IS NULL)))) |
observations | completed_time_and_state | ((((completed_time IS NULL) AND (state_id <> ALL (ARRAY[3, 5]))) OR ((completed_time IS NOT NULL) AND (state_id = ANY (ARRAY[3, 5]))))) |
observations | end_after_start | ((start_date <= end_date)) |
observed_site_species_totals | species_identifier_for_certainty | ((((certainty_id = 1) AND (species_id IS NOT NULL) AND (species_name IS NULL)) OR ((certainty_id = 2) AND (species_id IS NULL) AND (species_name IS NOT NULL)) OR ((certainty_id = 3) AND (species_id IS NULL) AND (species_name IS NULL)))) |
planting_zones | area_positive | ((area_ha > (0)::numeric)) |
planting_zones | must_have_permanent_clusters | ((num_permanent_clusters > 0)) |
planting_zones | must_have_temporary_plots | ((num_temporary_plots > 0)) |
planting_zones | positive_target_density | ((target_planting_density > (0)::numeric)) |