Columns
Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | int8 | 19 | null |
|
|
Globally-unique internal identifier for the batch. Not typically presented to end users; “batch_number” is the user-facing identifier. |
||||||||||||||||||
version | int4 | 10 | null |
|
|
Increases by 1 each time the batch is modified. Used to detect when clients have stale data about batches. |
||||||||||||||||||
organization_id | int8 | 19 | null |
|
|
Which organization owns the nursery where this batch is located. |
||||||||||||||||||
facility_id | int8 | 19 | null |
|
|
Which nursery contains the batch. Facility must be of type “Nursery” and under the same organization as the species ID (enforced in application code). |
||||||||||||||||||
species_id | int8 | 19 | null |
|
|
Species of the batch’s plants. Must be under the same organization as the facility ID (enforced in application code). |
||||||||||||||||||
batch_number | text | 2147483647 | null |
|
|
User-friendly unique (per organization) identifier for the batch. Not used internally or in API; “id” is the internal identifier. |
||||||||||||||||||
added_date | date | 13 | null |
|
|
User-supplied date the batch was added to the nursery’s inventory. |
||||||||||||||||||
germinating_quantity | int4 | 10 | null |
|
|
Number of germinating seedlings currently available in inventory. Withdrawals cause this to decrease. |
||||||||||||||||||
not_ready_quantity | int4 | 10 | null |
|
|
Number of not-ready-for-planting seedlings currently available in inventory. Withdrawals cause this to decrease. |
||||||||||||||||||
ready_quantity | int4 | 10 | null |
|
|
Number of ready-for-planting seedlings currently available in inventory. Withdrawals cause this to decrease. |
||||||||||||||||||
latest_observed_germinating_quantity | int4 | 10 | null |
|
|
Latest user-observed number of germinating seedlings currently available in inventory. Withdrawals do not cause this to decrease. |
||||||||||||||||||
latest_observed_not_ready_quantity | int4 | 10 | null |
|
|
Latest user-observed number of not-ready-for-planting seedlings currently available in inventory. Withdrawals do not cause this to decrease. |
||||||||||||||||||
latest_observed_ready_quantity | int4 | 10 | null |
|
|
Latest user-observed number of ready-for-planting seedlings currently available in inventory. Withdrawals do not cause this to decrease. |
||||||||||||||||||
latest_observed_time | timestamptz | 35,6 | null |
|
|
When the latest user observation of seedling quantities took place. |
||||||||||||||||||
created_by | int8 | 19 | null |
|
|
Which user initially created the batch. |
||||||||||||||||||
created_time | timestamptz | 35,6 | null |
|
|
When the batch was initially created. |
||||||||||||||||||
modified_by | int8 | 19 | null |
|
|
Which user most recently modified the batch, either directly or by creating a withdrawal. |
||||||||||||||||||
modified_time | timestamptz | 35,6 | null |
|
|
When the batch was most recently modified, either directly or by creating a withdrawal. |
||||||||||||||||||
notes | text | 2147483647 | √ | null |
|
|
User-supplied freeform notes about batch. |
|||||||||||||||||
ready_by_date | date | 13 | √ | null |
|
|
User-supplied estimate of when the batch will be ready for planting. |
|||||||||||||||||
accession_id | int8 | 19 | √ | null |
|
|
If the batch was created by a nursery transfer from a seed bank, the originating accession ID. |
|||||||||||||||||
project_id | int8 | 19 | √ | null |
|
|
||||||||||||||||||
substrate_id | int4 | 10 | √ | null |
|
|
||||||||||||||||||
substrate_notes | text | 2147483647 | √ | null |
|
|
||||||||||||||||||
treatment_id | int4 | 10 | √ | null |
|
|
||||||||||||||||||
treatment_notes | text | 2147483647 | √ | null |
|
|
||||||||||||||||||
germination_rate | int4 | 10 | √ | null |
|
|
||||||||||||||||||
loss_rate | int4 | 10 | √ | null |
|
|
||||||||||||||||||
initial_batch_id | int8 | 19 | √ | null |
|
|
||||||||||||||||||
total_germinated | int4 | 10 | √ | null |
|
|
Total number of seedlings that have moved from Germinating to Not Ready status over the lifetime of the batch. This is the numerator for the germination rate calculation. |
|||||||||||||||||
total_germination_candidates | int4 | 10 | √ | null |
|
|
Total number of seedlings that have been candidates for moving from Germinating to Not Ready status. This includes seedlings that are already germinated and germinating seedlings that were withdrawn as Dead, but does not include germinating seedlings that were withdrawn for other reasons. This is the denominator for the germination rate calculation. |
|||||||||||||||||
total_lost | int4 | 10 | √ | null |
|
|
Total number of non-germinating (Not Ready and Ready) seedlings that have been withdrawn as Dead. This is the numerator for the loss rate calculation. |
|||||||||||||||||
total_loss_candidates | int4 | 10 | √ | null |
|
|
Total number of non-germinating (Not Ready and Ready) seedlings that have been candidates for being withdrawn as dead. This includes seedlings that are still in the batch, seedlings that were withdrawn for outplanting, and seedlings that were already withdrawn as dead, but does not include germinating seedlings or seedlings that were withdrawn for other reasons. This is the denominator for the loss rate calculation. |
Indexes
Constraint Name | Type | Sort | Column(s) |
---|---|---|---|
batches_pkey | Primary key | Asc | id |
batches__species_id_ix | Performance | Asc | species_id |
batches_facility_id_id_key | Must be unique | Asc/Asc | facility_id + id |
batches_initial_batch_id_idx | Performance | Asc | initial_batch_id |
batches_organization_id_batch_number_key | Must be unique | Asc/Asc | organization_id + batch_number |
batches_organization_id_species_id_idx | Performance | Asc/Asc | organization_id + species_id |
batches_project_id_idx | Performance | Asc | project_id |
Check Constraints
Constraint Name | Constraint |
---|---|
batches_germinating_quantity_check | ((germinating_quantity >= 0)) |
batches_latest_observed_germinating_quantity_check | ((latest_observed_germinating_quantity >= 0)) |
batches_not_ready_quantity_check | ((not_ready_quantity >= 0)) |
batches_notes_check | ((notes !~ similar_to_escape(' *'::text))) |
batches_ready_quantity_check | ((ready_quantity >= 0)) |
batches_version_check | ((version > 0)) |
batches_latest_observed_not_ready_quantity_check | ((latest_observed_not_ready_quantity >= 0)) |
batches_latest_observed_ready_quantity_check | ((latest_observed_ready_quantity >= 0)) |