observations

0 rows


Description

Scheduled observations of planting sites. This table may contain rows describing future observations as well as current and past ones.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int8 19 null
observation_biomass_details.observation_id observation_biomass_details_observation_id_fkeyC
observation_biomass_quadrat_details.observation_id observation_biomass_quadrat_details_observation_id_fkeyC
observation_biomass_quadrat_species.observation_id observation_biomass_quadrat_species_observation_id_fkeyC
observation_biomass_species.observation_id observation_biomass_species_observation_id_fkeyC
observation_photos.observation_id observation_photos_observation_id_fkeyR
observation_plot_conditions.observation_id observation_plot_conditions_observation_id_fkeyC
observation_plots.observation_id observation_plots_observation_id_fkeyC
observation_requested_subzones.observation_id observation_requested_subzones_observation_id_fkeyC
observed_plot_coordinates.observation_id observed_plot_coordinates_observation_id_fkeyC
observed_plot_species_totals.observation_id observed_plot_species_totals_observation_id_fkeyC
observed_site_species_totals.observation_id observed_site_species_totals_observation_id_fkeyC
observed_subzone_species_totals.observation_id observed_subzone_species_totals_observation_id_fkeyC
observed_zone_species_totals.observation_id observed_zone_species_totals_observation_id_fkeyC
recorded_plants.observation_id recorded_plants_observation_id_fkeyC
recorded_trees.observation_id recorded_trees_observation_id_fkeyC
planting_site_id int8 19 null
planting_sites.id observations_planting_site_id_fkeyC
created_time timestamptz 35,6 null
start_date date 13 null

First day of the observation. This is either the first day of the month following the end of the planting season, or 6 months after that day.

end_date date 13 null

Last day of the observation. This is typically the last day of the same month as start_date.

completed_time timestamptz 35,6 null

Server-generated date and time the final piece of data for the observation was received.

state_id int4 10 null
observation_states.id observations_state_id_fkeyR
upcoming_notification_sent_time timestamptz 35,6 null

When the notification that the observation is starting in 1 month was sent. Null if the notification has not been sent yet.

planting_site_history_id int8 19 null
planting_site_histories.id observations_planting_site_history_id_fkeyC

Which version of the planting site map was used for the observation. Null for upcoming observations since monitoring plots are only placed on the map when an observation starts.

observation_type_id int4 10 null
observation_types.id observations_observation_type_id_fkeyR
is_ad_hoc bool 1 null

Indexes

Constraint Name Type Sort Column(s)
observations_pkey Primary key Asc id
observations_planting_site_history_id_idx Performance Asc planting_site_history_id
observations_planting_site_id_idx Performance Asc planting_site_id

Check Constraints

Constraint Name Constraint
history_id_required_at_start ((((state_id = 1) AND (planting_site_history_id IS NULL)) OR ((state_id <> 1) AND (planting_site_history_id IS NOT NULL))))
completed_time_and_state ((((completed_time IS NULL) AND (state_id <> ALL (ARRAY[3, 5]))) OR ((completed_time IS NOT NULL) AND (state_id = ANY (ARRAY[3, 5])))))
end_after_start ((start_date <= end_date))

Relationships