Columns
Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||
---|---|---|---|---|---|---|---|---|---|---|
batch_id | int8 | 19 | null |
|
|
The batch from which the seedlings were withdrawn, also referred to as the originating batch. |
||||
withdrawal_id | int8 | 19 | null |
|
|
The withdrawal that removed seedlings from this batch. A withdrawal can come from multiple batches, in which case there will be more than one |
||||
germinating_quantity_withdrawn | int4 | 10 | null |
|
|
Number of germinating seedlings that were withdrawn from this batch. This is not necessarily the total number of seedlings in the withdrawal as a whole since a withdrawal can come from multiple batches. |
||||
not_ready_quantity_withdrawn | int4 | 10 | null |
|
|
Number of not-ready-for-planting seedlings that were withdrawn from this batch. This is not necessarily the total number of seedlings in the withdrawal as a whole since a withdrawal can come from multiple batches. |
||||
ready_quantity_withdrawn | int4 | 10 | null |
|
|
Number of ready-for-planting seedlings that were withdrawn from this batch. This is not necessarily the total number of seedlings in the withdrawal as a whole since a withdrawal can come from multiple batches. |
||||
destination_batch_id | int8 | 19 | √ | null |
|
|
If the withdrawal was a nursery transfer, the batch that was created as a result. A withdrawal can have more than one originating batch; if they are of the same species, only one destination batch will be created and there will be multiple rows with the same |
Indexes
Constraint Name | Type | Sort | Column(s) |
---|---|---|---|
batch_withdrawals_pkey | Primary key | Asc/Asc | batch_id + withdrawal_id |
batch_withdrawals_destination_batch_id_idx | Performance | Asc | destination_batch_id |
batch_withdrawals_withdrawal_id_idx | Performance | Asc | withdrawal_id |
Check Constraints
Constraint Name | Constraint |
---|---|
quantity_signs_consistent | ((((germinating_quantity_withdrawn <= 0) AND (not_ready_quantity_withdrawn <= 0) AND (ready_quantity_withdrawn <= 0)) OR ((germinating_quantity_withdrawn >= 0) AND (not_ready_quantity_withdrawn >= 0) AND (ready_quantity_withdrawn >= 0)))) |