42 Foreign Key Constraints
| Constraint Name | Child Column | Parent Column | Delete Rule | ||
|---|---|---|---|---|---|
| accession_collectors_accession_id_fkey |
|
|
Cascade on delete | ||
| geolocations_accession_id_fkey |
|
|
Cascade on delete | ||
| accession_state_history_updated_by_fkey |
|
|
Restrict delete | ||
| accession_state_history_old_state_id_fkey |
|
|
Restrict delete | ||
| accession_state_history_new_state_id_fkey |
|
|
Restrict delete | ||
| accession_state_history_accession_id_fkey |
|
|
Cascade on delete | ||
| accessions_created_by_fkey |
|
|
Restrict delete | ||
| accessions_facility_id_fkey |
|
|
Cascade on delete | ||
| accession_storage_location_id_fkey |
|
|
Restrict delete | ||
| accessions_latest_observed_units_id_fkey |
|
|
Restrict delete | ||
| accessions_collection_source_id_fkey |
|
|
Restrict delete | ||
| accessions_collection_site_country_code_fkey |
|
|
Restrict delete | ||
| accession_subset_weight_units_id_fkey |
|
|
Restrict delete | ||
| accessions_modified_by_fkey |
|
|
Restrict delete | ||
| accessions_data_source_id_fkey |
|
|
Restrict delete | ||
| accessions_est_weight_units_id_fkey |
|
|
Restrict delete | ||
| accession_remaining_units_id_fkey |
|
|
Restrict delete | ||
| accession_state_id_fkey |
|
|
Restrict delete | ||
| accessions_species_id_fkey |
|
|
Restrict delete | ||
| accessions_project_id_fkey |
|
|
Null on delete | ||
| accessions_total_withdrawn_weight_units_id_fkey |
|
|
Restrict delete | ||
| viability_tests_accession_id_fkey |
|
|
Cascade on delete | ||
| germination_test_substrate_id_fkey |
|
|
Restrict delete | ||
| germination_test_treatment_id_fkey |
|
|
Restrict delete | ||
| germination_test_seed_type_id_fkey |
|
|
Restrict delete | ||
| germination_test_test_type_fkey |
|
|
Restrict delete | ||
| viability_test_results_test_id_fkey |
|
|
Cascade on delete | ||
| bags_accession_id_fkey |
|
|
Cascade on delete | ||
| accession_photo_accession_id_fkey |
|
|
Restrict delete | ||
| accession_photos_photo_id_fkey |
|
|
Restrict delete | ||
| withdrawals_estimated_weight_units_id_fkey |
|
|
Restrict delete | ||
| withdrawals_created_by_fkey |
|
|
Restrict delete | ||
| withdrawal_purpose_id_fkey |
|
|
Restrict delete | ||
| withdrawals_batch_id_fkey |
|
|
Null on delete | ||
| withdrawals_accession_id_fkey |
|
|
Cascade on delete | ||
| withdrawal_withdrawn_units_id_fkey |
|
|
Restrict delete | ||
| withdrawals_withdrawn_by_fkey |
|
|
Restrict delete | ||
| withdrawals_viability_test_id_fkey |
|
|
Cascade on delete | ||
| accession_quantity_history_remaining_units_id_fkey |
|
|
Restrict delete | ||
| accession_quantity_history_history_type_id_fkey |
|
|
Restrict delete | ||
| accession_quantity_history_accession_id_fkey |
|
|
Cascade on delete | ||
| accession_quantity_history_created_by_fkey |
|
|
Restrict delete |
Check Constraints
| Table | Constraint Name | Constraint |
|---|---|---|
| accession_collectors | accession_collectors_name_check | (name !~ similar_to_escape('\s*'::text)) |
| accession_collectors | accession_collectors_position_check | ("position" >= 0) |
| accessions | accessions_collection_site_city_check | (collection_site_city !~ similar_to_escape(' *'::text)) |
| accessions | accessions_collection_site_country_code_check | (collection_site_country_code !~ similar_to_escape(' *'::text)) |
| accessions | accessions_collection_site_country_subdivision_check | (collection_site_country_subdivision !~ similar_to_escape(' *'::text)) |
| accessions | accessions_collection_site_landowner_check | (collection_site_landowner !~ similar_to_escape(' *'::text)) |
| accessions | accessions_collection_site_name_check | (collection_site_name !~ similar_to_escape(' *'::text)) |
| accessions | accessions_collection_site_notes_check | (collection_site_notes !~ similar_to_escape(' *'::text)) |
| accessions | accessions_founder_id_check | (founder_id !~ similar_to_escape(' *'::text)) |
| accessions | accessions_number_check | (number !~ similar_to_escape(' *'::text)) |
| accessions | accessions_processing_notes_check | (processing_notes !~ similar_to_escape(' *'::text)) |
| accessions | observed_quantity_must_have_time | (((latest_observed_quantity IS NOT NULL) AND (latest_observed_time IS NOT NULL)) OR ((latest_observed_quantity IS NULL) AND (latest_observed_time IS NULL))) |
| accessions | observed_quantity_must_have_units | (((latest_observed_quantity IS NOT NULL) AND (latest_observed_units_id IS NOT NULL)) OR ((latest_observed_quantity IS NULL) AND (latest_observed_units_id IS NULL))) |
| accessions | remaining_quantity_must_have_units | (((remaining_quantity IS NOT NULL) AND (remaining_units_id IS NOT NULL)) OR ((remaining_quantity IS NULL) AND (remaining_units_id IS NULL))) |
| accessions | subset_weight_quantity_must_have_units | (((subset_weight_quantity IS NOT NULL) AND (subset_weight_units_id IS NOT NULL)) OR ((subset_weight_quantity IS NULL) AND (subset_weight_units_id IS NULL))) |
| accessions | subset_weight_units_must_not_be_seeds | ((subset_weight_units_id <> 1) OR (subset_weight_units_id IS NULL)) |
| viability_tests | viability_tests_notes_check | (notes !~ similar_to_escape(' *'::text)) |
| viability_tests | viability_tests_staff_responsible_check | (staff_responsible !~ similar_to_escape(' *'::text)) |
| bags | bags_bag_number_check | (bag_number !~ similar_to_escape(' *'::text)) |
| withdrawals | estimated_weight_must_have_units | (((estimated_weight_quantity IS NOT NULL) AND (estimated_weight_units_id IS NOT NULL)) OR ((estimated_weight_quantity IS NULL) AND (estimated_weight_units_id IS NULL))) |
| withdrawals | withdrawals_destination_check | (destination !~ similar_to_escape(' *'::text)) |
| withdrawals | withdrawals_notes_check | (notes !~ similar_to_escape(' *'::text)) |
| withdrawals | withdrawals_staff_responsible_check | (staff_responsible !~ similar_to_escape(' *'::text)) |
| withdrawals | withdrawals_test_id_requires_purpose | (((viability_test_id IS NULL) AND ((purpose_id IS NULL) OR (purpose_id <> 7))) OR ((viability_test_id IS NOT NULL) AND (purpose_id IS NOT NULL) AND (purpose_id = 7))) |
| withdrawals | withdrawals_viability_testing_has_test_id | (((purpose_id <> 7) AND (viability_test_id IS NULL)) OR ((purpose_id = 7) AND (viability_test_id IS NOT NULL))) |