41 Foreign Key Constraints
| Constraint Name | Child Column | Parent Column | Delete Rule | ||||
|---|---|---|---|---|---|---|---|
| batch_photos_batch_id_fkey |
|
|
Restrict delete | ||||
| batch_photos_created_by_fkey |
|
|
Restrict delete | ||||
| batch_photos_deleted_by_fkey |
|
|
Restrict delete | ||||
| batch_photos_file_id_fkey |
|
|
Null on delete | ||||
| batch_withdrawals_destination_batch_id_fkey |
|
|
Null on delete | ||||
| batch_withdrawals_batch_id_fkey |
|
|
Cascade on delete | ||||
| batch_withdrawals_withdrawal_id_fkey |
|
|
Cascade on delete | ||||
| batch_quantity_history_withdrawal_id_fkey |
|
|
Cascade on delete | ||||
| batch_quantity_history_created_by_fkey |
|
|
Restrict delete | ||||
| batch_quantity_history_history_type_id_fkey |
|
|
Restrict delete | ||||
| batch_quantity_history_batch_id_fkey |
|
|
Cascade on delete | ||||
| batch_sub_locations_batch_id_fkey |
|
|
Cascade on delete | ||||
| batch_sub_locations_facility_id_batch_id_fkey |
|
|
Restrict delete | ||||
| batch_sub_locations_facility_id_sub_location_id_fkey |
|
|
Restrict delete | ||||
| batch_sub_locations_sub_location_id_fkey |
|
|
Cascade on delete | ||||
| batch_sub_locations_facility_id_fkey |
|
|
Cascade on delete | ||||
| withdrawals_undoes_withdrawal_id_fkey |
|
|
Cascade on delete | ||||
| withdrawals_facility_id_fkey |
|
|
Cascade on delete | ||||
| withdrawals_created_by_fkey |
|
|
Restrict delete | ||||
| withdrawals_purpose_id_fkey |
|
|
Restrict delete | ||||
| withdrawals_destination_facility_id_fkey |
|
|
Null on delete | ||||
| withdrawals_modified_by_fkey |
|
|
Restrict delete | ||||
| withdrawal_photos_photo_id_fkey |
|
|
Restrict delete | ||||
| withdrawal_photos_withdrawal_id_fkey |
|
|
Restrict delete | ||||
| batches_treatment_id_fkey |
|
|
Restrict delete | ||||
| batches_modified_by_fkey |
|
|
Restrict delete | ||||
| batches_substrate_id_fkey |
|
|
Restrict delete | ||||
| batches_created_by_fkey |
|
|
Restrict delete | ||||
| batches_species_id_fkey |
|
|
Restrict delete | ||||
| batches_facility_id_fkey |
|
|
Cascade on delete | ||||
| batches_accession_id_fkey |
|
|
Null on delete | ||||
| batches_project_id_fkey |
|
|
Null on delete | ||||
| batches_organization_id_fkey |
|
|
Cascade on delete | ||||
| batches_initial_batch_id_fkey |
|
|
Null on delete | ||||
| batch_details_history_substrate_id_fkey |
|
|
Restrict delete | ||||
| batch_details_history_batch_id_fkey |
|
|
Cascade on delete | ||||
| batch_details_history_treatment_id_fkey |
|
|
Restrict delete | ||||
| batch_details_history_created_by_fkey |
|
|
Restrict delete | ||||
| batch_details_history_project_id_fkey |
|
|
Null on delete | ||||
| batch_details_history_sub_locations_sub_location_id_fkey |
|
|
Null on delete | ||||
| batch_details_history_sub_locatio_batch_details_history_id_fkey |
|
|
Cascade on delete |
Check Constraints
| Table | Constraint Name | Constraint |
|---|---|---|
| batch_withdrawals | quantity_signs_consistent | (((germinating_quantity_withdrawn <= 0) AND (active_growth_quantity_withdrawn <= 0) AND (ready_quantity_withdrawn <= 0)) OR ((germinating_quantity_withdrawn >= 0) AND (active_growth_quantity_withdrawn >= 0) AND (ready_quantity_withdrawn >= 0))) |
| batch_quantity_history | batch_quantity_history_germinating_quantity_check | (germinating_quantity >= 0) |
| batch_quantity_history | batch_quantity_history_not_ready_quantity_check | (active_growth_quantity >= 0) |
| batch_quantity_history | batch_quantity_history_ready_quantity_check | (ready_quantity >= 0) |
| withdrawals | undo_requires_withdrawal_id | (((purpose_id = 5) AND (undoes_withdrawal_id IS NOT NULL)) OR ((purpose_id <> 5) AND (undoes_withdrawal_id IS NULL))) |
| withdrawals | withdrawals_destination_only_for_transfers | ((destination_facility_id IS NULL) OR (purpose_id = 1)) |
| withdrawals | withdrawals_notes_check | (notes !~ similar_to_escape(' *'::text)) |
| batches | batches_germinating_quantity_check | (germinating_quantity >= 0) |
| batches | batches_latest_observed_germinating_quantity_check | (latest_observed_germinating_quantity >= 0) |
| batches | batches_latest_observed_not_ready_quantity_check | (latest_observed_active_growth_quantity >= 0) |
| batches | batches_latest_observed_ready_quantity_check | (latest_observed_ready_quantity >= 0) |
| batches | batches_not_ready_quantity_check | (active_growth_quantity >= 0) |
| batches | batches_notes_check | (notes !~ similar_to_escape(' *'::text)) |
| batches | batches_ready_quantity_check | (ready_quantity >= 0) |
| batches | batches_version_check | (version > 0) |