Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int8 | 19 | √ | null |
|
|
|||||||||||||||||
| facility_id | int8 | 19 | null |
|
|
Nursery from which the seedlings were withdrawn. |
|||||||||||||||||
| purpose_id | int4 | 10 | null |
|
|
Purpose of the withdrawal (nursery transfer, dead seedlings, etc.) |
|||||||||||||||||
| withdrawn_date | date | 13 | null |
|
|
User-supplied date when the seedlings were withdrawn. |
|||||||||||||||||
| created_by | int8 | 19 | null |
|
|
Which user created the withdrawal. |
|||||||||||||||||
| created_time | timestamptz | 35,6 | null |
|
|
When the withdrawal was created. |
|||||||||||||||||
| modified_by | int8 | 19 | null |
|
|
Which user most recently modified the withdrawal. |
|||||||||||||||||
| modified_time | timestamptz | 35,6 | null |
|
|
When the withdrawal was most recently modified. |
|||||||||||||||||
| destination_facility_id | int8 | 19 | √ | null |
|
|
If the withdrawal was a nursery transfer, the facility where the seedlings were sent. May be null if the facility was subsequently deleted. |
||||||||||||||||
| notes | text | 2147483647 | √ | null |
|
|
User-supplied freeform text describing the withdrawal. |
||||||||||||||||
| undoes_withdrawal_id | int8 | 19 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| withdrawals_pkey | Primary key | Asc | id |
| withdrawals_destination_facility_id_idx | Performance | Asc | destination_facility_id |
| withdrawals_facility_id_idx | Performance | Asc | facility_id |
| withdrawals_undoes_withdrawal_id_key | Must be unique | Asc | undoes_withdrawal_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| withdrawals_destination_only_for_transfers | ((destination_facility_id IS NULL) OR (purpose_id = 1)) |
| withdrawals_notes_check | (notes !~ similar_to_escape(' *'::text)) |
| undo_requires_withdrawal_id | (((purpose_id = 5) AND (undoes_withdrawal_id IS NOT NULL)) OR ((purpose_id <> 5) AND (undoes_withdrawal_id IS NULL))) |