withdrawals

0 rows


Description

Information about seeds that have been withdrawn from a seed bank. Each time someone withdraws seeds, a new row is inserted here.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int8 19 null
accession_id int8 19 null
accessions.id withdrawals_accession_id_fkeyC
date date 13 null
purpose_id int4 10 null
withdrawal_purposes.id withdrawal_purpose_id_fkeyR
destination text 2147483647 null
staff_responsible text 2147483647 null
created_time timestamptz 35,6 null
updated_time timestamptz 35,6 null
notes text 2147483647 null
viability_test_id int8 19 null
viability_tests.id withdrawals_viability_test_id_fkeyC
withdrawn_grams numeric 131089 null
withdrawn_quantity numeric 131089 null
withdrawn_units_id int4 10 null
seed_quantity_units.id withdrawal_withdrawn_units_id_fkeyR
estimated_count int4 10 null
estimated_weight_quantity numeric 131089 null
estimated_weight_units_id int4 10 null
seed_quantity_units.id withdrawals_estimated_weight_units_id_fkeyR
created_by int8 19 null
users.id withdrawals_created_by_fkeyR
withdrawn_by int8 19 null
users.id withdrawals_withdrawn_by_fkeyR
batch_id int8 19 null
batches.id withdrawals_batch_id_fkeyN

Indexes

Constraint Name Type Sort Column(s)
withdrawal_pkey Primary key Asc id
withdrawal__accession_id_ix Performance Asc accession_id
withdrawal__date_ix Performance Asc date
withdrawals_batch_id_idx Performance Asc batch_id
withdrawals_viability_test_id_unique Must be unique Asc viability_test_id

Check Constraints

Constraint Name Constraint
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_staff_responsible_check ((staff_responsible !~ similar_to_escape(' *'::text)))
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))))
withdrawals_notes_check ((notes !~ similar_to_escape(' *'::text)))
withdrawals_destination_check ((destination !~ similar_to_escape(' *'::text)))
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))))

Relationships