project_species

-1 rows


Description

Information about species in the context of specific projects, if applicable.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
organization_id int8 19 null
organizations.id project_species_organization_id_fkey C
project_id int8 19 null
projects.id project_species_project_id_fkey C

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
species.id project_species_species_id_fkey C
calculated_nativity_id int4 10 null
species_nativities.id project_species_calculated_nativity_id_fkey R
calculated_nativity_dataset_type_id int4 10 null
external_dataset_types.id project_species_calculated_nativity_dataset_type_id_fkey R
calculated_nativity_dataset_date date 13 null
overridden_nativity_id int4 10 null
species_nativities.id project_species_overridden_nativity_id_fkey R
overridden_justification text 2147483647 null
overridden_by int8 19 null
users.id project_species_overridden_by_fkey R
overridden_time timestamptz 35,6 null
pending_nativity_id int4 10 null
species_nativities.id project_species_pending_nativity_id_fkey R
pending_nativity_dataset_date date 13 null
pending_nativity_dataset_type_id int4 10 null
external_dataset_types.id project_species_pending_nativity_dataset_type_id_fkey R

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))

Relationships