Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| organization_id | int8 | 19 | null |
|
|
||||||
| project_id | int8 | 19 | √ | null |
|
|
If the information about this species only applies to one of an organization’s projects, the project ID. Null if the organization has no projects (in which case we treat the organization as a “project”). |
||||
| species_id | int8 | 19 | null |
|
|
||||||
| calculated_nativity_id | int4 | 10 | √ | null |
|
|
|||||
| calculated_nativity_dataset_type_id | int4 | 10 | √ | null |
|
|
|||||
| calculated_nativity_dataset_date | date | 13 | √ | null |
|
|
|||||
| overridden_nativity_id | int4 | 10 | √ | null |
|
|
|||||
| overridden_justification | text | 2147483647 | √ | null |
|
|
|||||
| overridden_by | int8 | 19 | √ | null |
|
|
|||||
| overridden_time | timestamptz | 35,6 | √ | null |
|
|
|||||
| pending_nativity_id | int4 | 10 | √ | null |
|
|
|||||
| pending_nativity_dataset_date | date | 13 | √ | null |
|
|
|||||
| pending_nativity_dataset_type_id | int4 | 10 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| project_species_organization_id_project_id_species_id_idx | Must be unique | Asc/Asc/Asc | organization_id + project_id + species_id |
| project_species_project_id_idx | Performance | Asc | project_id |
| project_species_species_id_idx | Performance | Asc | species_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| known_nativity_has_dataset | ((((calculated_nativity_id = 4) OR (calculated_nativity_id IS NULL)) AND (calculated_nativity_dataset_date IS NULL)) OR (calculated_nativity_dataset_date IS NOT NULL)) |
| known_pending_nativity_has_dataset | ((((pending_nativity_id = 4) OR (pending_nativity_id IS NULL)) AND (pending_nativity_dataset_date IS NULL)) OR (pending_nativity_dataset_date IS NOT NULL)) |
| pending_nativity_dataset_has_both_values | ((pending_nativity_dataset_date IS NULL) = (pending_nativity_dataset_type_id IS NULL)) |
| nativity_dataset_has_both_values | ((calculated_nativity_dataset_date IS NULL) = (calculated_nativity_dataset_type_id IS NULL)) |