Annotation Database Entity Documentation: Difference between revisions

From MediaWiki
Jump to navigation Jump to search
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Overview =
The database is large, complex and relational with a lot of entities describing many facets of ROV operations, measurements and observations.
The database is large, complex and relational with a lot of entities describing many facets of ROV operations, measurements and observations.


There are several schemas that store information in a variety of categories. These are described here, but listed below in more detail.
= Notes About Specific Entities =


== Schemas ==
These notes about specific entities complement the generated documentation below.


=== wiki ===
== [[#rov.dive|rov.dive]] and [[#rov.transect|rov.transect]] ==


The <code>wiki</code> schema contains tables related to the Wiki -- the page you are currently looking at.
Dives represent the span of time during which an ROV, submersible or drop camera is in the water, but may also represent the time during which the instruments are operating. In cases when the instrument data are contained entirely within the time span logged by the operator, the times are recorded unchanged. When the instrument data extend beyond the recorded times of the dive, they may be extended. Occasionally, the operator will record an erroneous time, or omit a time altogether. The instrument times can help to reconstruct this history. Dives also relate to important configuration information, objectives, crew and operational notes.


=== rov ===
Transects are defined by their start and end times, contained entirely within dives and do not cross the boundaries between dives. They do not have any related entities and function mainly as accounting items. However, they are extremely important in the analysis of observations and measurements collected during the dive. For example, if one is calculating the density of a particular population of organisms, one must know the precise geographic extent of the region. Transects accomplish this and store objectives and operational notes.


The <code>rov</code> schema contains all the information related to ROV and submersible, from the cruises and dives to personnel, to equipment configuration, water properties and species and habitat observations.
In instances where the times of transects are not recorded, or lost, they can sometimes be reconstructed from status events in the observation record (e.g., a VideoMiner database may have transect start/end events). Otherwise, they are not recorded at all. Ideally, transect records are present and their start and end times are recorded without modification, so long as they are reasonable (i.e., the end time occurs after the start time).


=== shared ===
= Generated Documentation =


The <code>shared</code> schema contains entities that are shared between other schemas. These include site users, people, taxonomy, etc.
Database entity documentation is generated from the production database by the script, [https://gitlab.com/rskelly/msea-rov-db/-/blob/main/utilities/maintenance/db_generate_docs.py db_generate_docs.py]. The script outputs a file whose contents can be copied into this page after the &lt;!-- BEGIN GENERATED CONTENT --&gt; tag.


=== obis ===
The documentation is arranged into conceptual groupings with the following structure.


Stores the OBIS taxonomic database.
* Schema
** Table
** Materialized View
** View


=== inaturalist ===
System and Django tables aren't included. The ID column of each table is also excluded.


Stores the iNaturalist taxonomic database.
== Database Comments ==
 
=== ndst ===
 
Stores data imported directly from the [https://msea.science/Dive-Logging-App/ Dive Logging App], which records information about cruises, dives, transects and equipment by NDST. These are imported into the <code>rov</code> tables during the import process.
 
=== intertidal ===
 
Stores information about intertidal surveys. This isn't currently being used -- the UAS and related data are being stored in a separate [[Main_Page#Intertidal_Survey_Database|intertidal dabase]].
 
=== pa ===
 
Stores geospatial information about protected areas that can be used to query spatial data in other schemas.
 
= Database Comments =


Documentation resides in the database itself, in the form of comments on the relations and columns. Documentations can be created by executing SQL statements in the form,
Documentation resides in the database itself, in the form of comments on the relations and columns. Documentations can be created by executing SQL statements in the form,


    COMMENT ON SHCEMA [schema] IS 'This is a schema comment.'
     COMMENT ON TABLE [schema].[table name] IS 'This is a table comment.'
     COMMENT ON TABLE [schema].[table name] IS 'This is a table comment.'
     COMMENT ON COLUMN [schema].[table name].[column name] IS 'This is a column comment.'
     COMMENT ON COLUMN [schema].[table name].[column name] IS 'This is a column comment.'
Line 48: Line 36:
Comments are managed using DDL, as described on the [[Annotation_Database#Database_Upgrades|Database Upgrades]] page.
Comments are managed using DDL, as described on the [[Annotation_Database#Database_Upgrades|Database Upgrades]] page.


= Generating Documentation =
== Generated Entity Documentation ==
 
Database entity documentation is generated from the production database by the script, [https://gitlab.com/rskelly/msea-rov-db/-/blob/main/utilities/maintenance/db_generate_docs.py db_generate_docs.py].
 
The documentation is arranged into conceptual groupings with the following structure.
 
* Schema
** Table
** Materialized View
** View
 
System and Django tables aren't included. The ID column of each table is also excluded.
 
= Generated Documentation =


''Note: this page is auto-generated from the documentation comments in the actual database. Do not edit it directly.''
''Note: this page is auto-generated from the documentation comments in the actual database. Do not edit it directly.''


<!-- BEGIN GENERATED CONTENT -->
<!-- BEGIN GENERATED CONTENT -->
== Schema: inaturalist ==
<span id="intertidal"></span>
== Schema: intertidal ==
 
Stores data for the intertidal database. Contains information about UAS flights, surveys and other derivative data.


<span id="inaturalist"></span>
<span id="intertidal.quadrat"></span>
<span id="inaturalist.observation"></span>
=== Table: quadrat ===
=== Table: observation ===


Stores observations from the [https://www.inaturalist.org/projects/marine-life-of-the-northeast-pacific iNaturalist species guide]. TODO: This table isn't linked to the [[#shared.taxon|taxon]] table by a foreign key relation because the taxon ID is not unique in this table.
A record of observations within an intertidal quadrat.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "observation"
|+ Columns in "quadrat"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| captive_cultivated || boolean || YES || True, if the observation is of a captive or farmed organism.
| centroid_height || real || YES || The elevation of the corner position in m (ellipsoidal).
|-
|-
| common_name || character varying || YES || The common name of the organism.
| centroid_lat || double precision || YES || The corner latitude.
|-
|-
| coordinates_obscured || boolean || YES || Indicates whether the coordinate is obscured for the public.
| centroid_lon || double precision || YES || The corner longitude.
|-
|-
| created_at || timestamp with time zone || YES || The time of creation of the record.
| corner_height1 || real || YES || The elevation of the corner position in m (ellipsoidal).
|-
|-
| description || text || YES || A description of the observation.
| corner_height2 || real || YES || The elevation of the corner position in m (ellipsoidal).
|-
|-
| geoprivacy || character varying || YES || Set to private if the record is not public. TODO: Other values?
| corner_height3 || real || YES || The elevation of the corner position in m (ellipsoidal).
|-
|-
| iconic_taxon_name || character varying || YES || Grouping by arbitrary taxonomic level.
| corner_height4 || real || YES || The elevation of the corner position in m (ellipsoidal).
|-
|-
| image_url || text || YES || A URL for an image of the observation.
| corner_lat1 || double precision || YES || The corner latitude.
|-
|-
| latitude || real || YES || The latitude of the observation.
| corner_lat2 || double precision || YES || The corner latitude.
|-
|-
| license || character varying || YES || The license applied to the record.
| corner_lat3 || double precision || YES || The corner latitude.
|-
|-
| longitude || real || YES || The longitude of the observation.
| corner_lat4 || double precision || YES || The corner latitude.
|-
|-
| num_identification_agreements || smallint || YES || The number of votes for the identifaction.
| corner_lon1 || double precision || YES || The corner longitude.
|-
|-
| num_identification_disagreements || smallint || YES || Number of votes against the identification.
| corner_lon2 || double precision || YES || The corner longitude.
|-
|-
| oauth_application_id || character varying || YES || The ID of an OAUTH application used to modify the record.
| corner_lon3 || double precision || YES || The corner longitude.
|-
|-
| observed_on || date || YES || The time of observation. Created by combining the observed_on and time_observed_at and time_zone fields.
| corner_lon4 || double precision || YES || The corner longitude.
|-
|-
| place_guess || character varying || YES || The informal name of the site of the observation.
| created_on || timestamp without time zone || NO || created_on = models.DateTimeField(default = datetime.utcnow, null = False)
|-
|-
| positional_accuracy || integer || YES || The positional accuracy of the observation position (m).
| flag_number || character varying || NO || The number of the flag used to mark the quadrat. May be non-numeric if necessary.
|-
|-
| positioning_device || character varying || YES || The device used to collect the position.
| geom || geometry || YES || A geometry representing either the corners of the quadrat (multipoint) or the centroid.
|-
|-
| positioning_method || character varying || YES || The positioning method.
| name || character varying || NO || A unique name for the quadrat.
|-
|-
| public_positional_accuracy || integer || YES || The positional accuracy of the position showed to the public (m).
| note || text || YES || An optional note about the quadrat.
|-
|-
| quality_grade || character varying || YES || The quality of the report. 'research' indicates that the record is authoritative.
| survey_id || integer || NO || A reference to the [[#intertidal.survey|intertidal suvey]].
|-
|-
| scientific_name || character varying || YES || The scientific name given to the observation.
| time || timestamp without time zone || NO || The time of the quadrat (UTC).
|-
|-
| sound_url || text || YES || A URL for a sound file for the record.
| transect || integer || NO || The transect number. This is an integer corresponding to whatever rubric was chosen for the survey.
|-
|-
| species_guess || character varying || YES || A guess at the species name.
| zone || integer || NO || The zone number. This is an integer corresponding to whatever rubric was chosen for the survey.
|}
 
<span id="intertidal.quadrat_observation"></span>
=== Table: quadrat_observation ===
 
Records observations within [[#intertidal.quadrat|quadrats]]. The observation type enumeration is defined in the database export panel.
 
{| class="wikitable"
|+ Columns in "quadrat_observation"
|-
|-
| tag_list || jsonb || YES || A list of tags associated with the observation. Represented as a JSON list.
! Name !! Type !! Nullable !! Documentation
|-
|-
| taxon_class_name || character varying || YES || The name of the taxon's class.
| cell || integer || YES || The quadrat cell, typically from 0 - 100.
|-
|-
| taxon_family_name || character varying || YES || The family of the taxon.
| count || integer || YES || The number of organisms observed.
|-
|-
| taxon_form_name || character varying || YES || The form of the taxon.
| coverage || real || YES || The percent coverage by the organism, 0-100. TODO: Not part of the specification.
|-
|-
| taxon_genus_name || character varying || YES || The genus of the taxon.
| length || real || YES || The measured length of an organism.
|-
|-
| taxon_genushybrid_name || character varying || YES || The hybrid genus of the taxon.
| quadrat_id || integer || NO || A link to the [[#intertidal.quadrat|quadrat]].
|-
|-
| taxon_geoprivacy || character varying || YES || The privacy setting of the taxon. 'open' or 'obscured'.
| surveytaxon_id || integer || NO || A link to the [[#intertidal.survey_taxon|survey taxon]].
|-
|-
| taxon_hybrid_name || character varying || YES || The hybrid name of the taxon.
| type || integer || YES || The type of observation; one of quadrat_obs_type.
|}
 
<span id="intertidal.quadrat_substrate"></span>
=== Table: quadrat_substrate ===
 
List substrates observed in intertidal quadrats.
 
{| class="wikitable"
|+ Columns in "quadrat_substrate"
|-
|-
| taxon_id || integer || NO || The iNaturalist taxon ID.
! Name !! Type !! Nullable !! Documentation
|-
|-
| taxon_kingdom_name || character varying || YES || The taxon' kingdom.
| name || character varying || NO || The name of the substrate.
|}
 
<span id="intertidal.quadrat_substrate_coverage"></span>
=== Table: quadrat_substrate_coverage ===
 
Associates [[#intertidal.quadrat_substrate|quadrat substrate]] coverages with [[#intertidal.quadrats|quadrats]].
 
{| class="wikitable"
|+ Columns in "quadrat_substrate_coverage"
|-
|-
| taxon_order_name || character varying || YES || The order of the taxon.
! Name !! Type !! Nullable !! Documentation
|-
|-
| taxon_phylum_name || character varying || YES || The taxon phylum.
| coverage || real || NO || The coverage amount between 0% and 100%.
|-
|-
| taxon_species_name || character varying || YES || The species of the taxon.
| quadrat_id || integer || NO || A reference to the [[#intertidal.quadrat|quadrat]].
|-
|-
| taxon_subclass_name || character varying || YES || The taxon's subclass.
| substrate_id || integer || NO || A reference to the [[#intertidal.quadrat_substrate|substrate]].
|-
|}
| taxon_subfamily_name || character varying || YES || The subfamily of the taxon.
 
|-
<span id="intertidal.survey"></span>
| taxon_suborder_name || character varying || YES || The suborder of a taxon.
=== Table: survey ===
 
Stores metadata about intertidal surveys.
 
{| class="wikitable"
|+ Columns in "survey"
|-
|-
| taxon_subphylum_name || character varying || YES || The taxon subphylum.
! Name !! Type !! Nullable !! Documentation
|-
|-
| taxon_subspecies_name || character varying || YES || The subspecies of the taxon.
| created_on || timestamp without time zone || NO || The time of creation of this record.
|-
|-
| taxon_subtribe_name || character varying || YES || The subtribe of the taxon.
| end_date || timestamp without time zone || YES || The end date of the survey.
|-
|-
| taxon_superclass_name || character varying || YES || The taxon superclass.
| name || character varying || NO || The name of the survey.
|-
|-
| taxon_superfamily_name || character varying || YES || The taxon's superfamily.
| note || text || YES || Notes about the survey.
|-
|-
| taxon_superorder_name || character varying || YES || The superorder of the taxon.
| objective || text || YES || The survey objective.
|-
|-
| taxon_supertribe_name || character varying || YES || The supertribe of the taxon.
| site_id || integer || YES || Relates the survey to a [[#shared.site|site]] entity.
|-
|-
| taxon_tribe_name || character varying || YES || The tribe of the taxon.
| start_date || timestamp without time zone || NO || The start date of the survey.
|-
| taxon_variety_name || character varying || YES || The variety name of the taxon.
|-
| updated_at || timestamp with time zone || YES || The time of update of the record.
|-
| url || text || YES || A URL pointing to the online record.
|-
| user_id || integer || YES || The ID of the iNaturalist user.
|-
| user_login || character varying || YES || The login name of the iNaturalist user.
|}
|}


== Schema: intertidal ==
<span id="intertidal.survey_crew"></span>
=== Table: survey_crew ===


<span id="intertidal"></span>
Associates [[#intertidal.survey|intertidal survey]] crew members with [[#intertidal.survey_role|roles]].
<span id="intertidal.quadrat"></span>
=== Table: quadrat ===
 
A record of observations within an intertidal quadrat.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "quadrat"
|+ Columns in "survey_crew"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| centroid_height || real || YES || The elevation of the corner position in m (ellipsoidal).
| note || text || YES || An optional note about the survey role.
|-
|-
| centroid_lat || double precision || YES || The corner latitude.
| person_id || integer || NO || A reference to the person with this [[#shared.person|role]].
|-
|-
| centroid_lon || double precision || YES || The corner longitude.
| role_id || integer || NO || A reference to the [[#intertidal.survey_role|role]].
|-
|-
| corner_height1 || real || YES || The elevation of the corner position in m (ellipsoidal).
| survey_id || integer || NO || A reference to the [[#intertidal.survey|survey]].
|}
 
<span id="intertidal.survey_role"></span>
=== Table: survey_role ===
 
A list of roles available to [[#intertidal.survey_crew|intertidal survey crew members]].
 
{| class="wikitable"
|+ Columns in "survey_role"
|-
|-
| corner_height2 || real || YES || The elevation of the corner position in m (ellipsoidal).
! Name !! Type !! Nullable !! Documentation
|-
|-
| corner_height3 || real || YES || The elevation of the corner position in m (ellipsoidal).
| name || character varying || NO || The name of the role.
|-
|-
| corner_height4 || real || YES || The elevation of the corner position in m (ellipsoidal).
| note || text || YES || A note about the role.
|}
 
<span id="intertidal.survey_taxon"></span>
=== Table: survey_taxon ===
 
Links [[#shared.taxon|taxon]] records to [[#intertidal.survey|intertidal surveys]].
 
{| class="wikitable"
|+ Columns in "survey_taxon"
|-
|-
| corner_lat1 || double precision || YES || The corner latitude.
! Name !! Type !! Nullable !! Documentation
|-
|-
| corner_lat2 || double precision || YES || The corner latitude.
| survey_id || integer || NO || A link to the [[#intertidal.survey|survey]].
|-
|-
| corner_lat3 || double precision || YES || The corner latitude.
| taxon_id || integer || NO || A link to the [[#shared.taxon|taxon]] record.
|}
 
<span id="ndst"></span>
== Schema: ndst ==
 
Contains tables that store transient data loaded from the [https://msea.science/Dive-Logging-App Dive Logging App] so it can be loaded into the ROV database.
 
<span id="ndst.cruise"></span>
=== Table: cruise ===
 
Contains information about a cruise, as entered by NDST staff. Will be combined with other data to populate the [[#rov.cruise|cruise]] table.
 
{| class="wikitable"
|+ Columns in "cruise"
|-
|-
| corner_lat4 || double precision || YES || The corner latitude.
! Name !! Type !! Nullable !! Documentation
|-
| corner_lon1 || double precision || YES || The corner longitude.
|-
|-
| corner_lon2 || double precision || YES || The corner longitude.
| active || boolean || NO || Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
|-
| corner_lon3 || double precision || YES || The corner longitude.
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
|-
|-
| corner_lon4 || double precision || YES || The corner longitude.
| hide || integer || NO || True if the entity should be hidden in the UI.
|-
|-
| created_on || timestamp without time zone || NO || created_on = models.DateTimeField(default = datetime.utcnow, null = False)
| leg || text || YES || The leg of the cruise. Should start at 1 and increase.
|-
|-
| flag_number || character varying || NO || The number of the flag used to mark the quadrat. May be non-numeric if necessary.
| name || text || YES || The name of the cruise.
|-
|-
| geom || geometry || YES || A geometry representing either the corners of the quadrat (multipoint) or the centroid.
| note || text || YES || The objective of the cruise.
|-
|-
| name || character varying || NO || A unique name for the quadrat.
| objective || text || YES || [None]
|-
|-
| note || text || YES || An optional note about the quadrat.
| row_id || text || YES || A UUID providing a universally-unique identifier for the cruise.
|-
| survey_id || integer || NO || A reference to the [[#intertidal.survey|intertidal suvey]].
|-
|-
| time || timestamp without time zone || NO || The time of the quadrat (UTC).
| status || character varying || YES || The current status of the cruise viz. database import.
|-
|-
| transect || integer || NO || The transect number. This is an integer corresponding to whatever rubric was chosen for the survey.
| summary || text || YES || A summary of the cruise, its accomplishments, problems, etc.
|-
|-
| zone || integer || NO || The zone number. This is an integer corresponding to whatever rubric was chosen for the survey.
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|}
|}


<span id="intertidal.quadrat_observation"></span>
<span id="ndst.diveconfig"></span>
=== Table: quadrat_observation ===
=== Table: diveconfig ===


Records observations within [[#intertidal.quadrat|quadrats]]. The observation type enumeration is defined in the database export panel.
Stores configurations for each dive, including the submersible, ship and any instruments on either.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "quadrat_observation"
|+ Columns in "diveconfig"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| cell || integer || YES || The quadrat cell, typically from 0 - 100.
| active || boolean || NO || Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
|-
|-
| count || integer || YES || The number of organisms observed.
| name || text || YES || The name of the dive config.
|-
|-
| coverage || real || YES || The percent coverage by the organism, 0-100. TODO: Not part of the specification.
| note || text || YES || A note about the dive config.
|-
|-
| length || real || YES || The measured length of an organism.
| row_id || text || YES || A UUID providing a universally-unique identifier for the entity.
|-
|-
| quadrat_id || integer || NO || A link to the [[#intertidal.quadrat|quadrat]].
| ship_config || text || YES || Stores the name of the [[#ndst.equipconfig|ship configuration]] during the dive.
|-
|-
| surveytaxon_id || integer || NO || A link to the [[#intertidal.survey_taxon|survey taxon]].
| ship_instrument_configs || text || YES || Stores the names of the [[#ndst.equipconfig|instruments]] on the ship during the dive.
|-
|-
| type || integer || YES || The type of observation; one of quadrat_obs_type.
| sub_config || text || YES || Stores the name of the [[#ndst.equipconfig|submersible configuration]] during the dive.
|}
 
<span id="intertidal.quadrat_substrate"></span>
=== Table: quadrat_substrate ===
 
List substrates observed in intertidal quadrats.
 
{| class="wikitable"
|+ Columns in "quadrat_substrate"
|-
|-
! Name !! Type !! Nullable !! Documentation
| sub_instrument_configs || text || YES || Stores the names of the [[#ndst.equipconfig|instruments]] on the sub during the dive.
|-
|-
| name || character varying || NO || The name of the substrate.
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|}
|}


<span id="intertidal.quadrat_substrate_coverage"></span>
<span id="ndst.dives"></span>
=== Table: quadrat_substrate_coverage ===
=== Table: dives ===


Associates [[#intertidal.quadrat_substrate|quadrat substrate]] coverages with [[#intertidal.quadrats|quadrats]].
Stores information about each dive.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "quadrat_substrate_coverage"
|+ Columns in "dives"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| coverage || real || NO || The coverage amount between 0% and 100%.
| active || boolean || NO || Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
|-
|-
| quadrat_id || integer || NO || A reference to the [[#intertidal.quadrat|quadrat]].
| cruise_name || text || YES || The name of the [[#ndst.cruise|cruise]].
|-
|-
| substrate_id || integer || NO || A reference to the [[#intertidal.quadrat_substrate|substrate]].
| dive_config || text || YES || The name of the [[#ndst.diveconfig|dive configuration]].
|}
|-
 
| end_time || text || YES || The time of dive ending.
<span id="intertidal.survey"></span>
|-
=== Table: survey ===
| hide || integer || NO || True if the entity should be hidden in the UI.
 
|-
Stores metadata about intertidal surveys.
| leg || text || YES || The leg of the [[#ndst.cruise|cruise]].
 
|-
{| class="wikitable"
| name || text || YES || The name of the dive.
|+ Columns in "survey"
|-
|-
! Name !! Type !! Nullable !! Documentation
| note || text || YES || A note about the dive.
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of this record.
| objective || text || YES || The objective of the dive.
|-
|-
| end_date || timestamp without time zone || YES || The end date of the survey.
| pilot || text || YES || The [[#ndst.person|pilot]](s) of the dive.
|-
|-
| name || character varying || NO || The name of the survey.
| row_id || text || YES || A UUID providing a universally-unique identifier for the entity.
|-
|-
| note || text || YES || Notes about the survey.
| site_name || text || YES || The name of the dive site.
|-
|-
| objective || text || YES || The survey objective.
| start_time || text || YES || The time of dive start.
|-
|-
| site_id || integer || YES || Relates the survey to a [[#shared.site|site]] entity.
| summary || text || YES || A summary of the dive, its accomplishments, problems, etc.
|-
|-
| start_date || timestamp without time zone || NO || The start date of the survey.
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|}
|}


<span id="intertidal.survey_crew"></span>
<span id="ndst.equipconfig"></span>
=== Table: survey_crew ===
=== Table: equipconfig ===


Associates [[#intertidal.survey|intertidal survey]] crew members with [[#intertidal.survey_role|roles]].
Stores configurations for [[#ndst.equipment|equipment]], including instruments and platforms.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "survey_crew"
|+ Columns in "equipconfig"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| note || text || YES || An optional note about the survey role.
| active || boolean || NO || Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| configuration || text || YES || A JSON object containing configuration properties.
|-
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
|-
|-
| person_id || integer || NO || A reference to the person with this [[#shared.person|role]].
| name || text || YES || The name of the equipment config.
|-
|-
| role_id || integer || NO || A reference to the [[#intertidal.survey_role|role]].
| note || text || YES || A note about the equipment config.
|-
|-
| survey_id || integer || NO || A reference to the [[#intertidal.survey|survey]].
| row_id || text || YES || A UUID providing a universally-unique identifier for the entity.
|-
| short_code || text || YES || A short, easy-to-use identifier for the configuration.
|-
| type || text || YES || The type of equipment.
|-
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|}
|}


<span id="intertidal.survey_role"></span>
<span id="ndst.equipment"></span>
=== Table: survey_role ===
=== Table: equipment ===


A list of roles available to [[#intertidal.survey_crew|intertidal survey crew members]].
Stores equipment, including instruments and platforms.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "survey_role"
|+ Columns in "equipment"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the role.
| active || boolean || NO || Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| brand || text || YES || The brand name of the equipment.
|-
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
|-
| instrument_id || integer || YES || The ID of the [[#rov.instrument|instrument]] in the ROV database. Mutually exclusive with platform_id.
|-
| model || text || YES || The model name of the equipment.
|-
| note || text || YES || A note about the equipment.
|-
| platform_id || integer || YES || The ID of the [[#rov.platform|platform]] in the ROV database. Mutually exclusive with instrument_id.
|-
| row_id || text || YES || A UUID providing a universally-unique identifier for the entity.
|-
| serial_number || text || YES || The serial number.
|-
| short_code || text || YES || The short code for the equipment as used in the [[#rov.equipment|ROV database equipment table]].
|-
| short_code_mapped || character varying || YES || An optional mapping from the origin short code to an internal short code. Not unique because multiple source items can map to a single internal item.
|-
| type || text || YES || The type of equipment.
|-
|-
| note || text || YES || A note about the role.
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|}
|}


<span id="intertidal.survey_taxon"></span>
<span id="ndst.people"></span>
=== Table: survey_taxon ===
=== Table: people ===


Links [[#shared.taxon|taxon]] records to [[#intertidal.survey|intertidal surveys]].
Stores the people who worked on the [[#ndst.cruise|cruise]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "survey_taxon"
|+ Columns in "people"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| survey_id || integer || NO || A link to the [[#intertidal.survey|survey]].
| active || boolean || NO || Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
|-
| taxon_id || integer || NO || A link to the [[#shared.taxon|taxon]] record.
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
|}
 
== Schema: ndst ==
 
<span id="ndst"></span>
<span id="ndst.cruise"></span>
=== Table: cruise ===
 
None
 
{| class="wikitable"
|+ Columns in "cruise"
|-
! Name !! Type !! Nullable !! Documentation
|-
| active || boolean || NO || [None]
|-
| created_on || timestamp without time zone || NO || [None]
|-
| leg || text || YES || [None]
|-
|-
| name || text || YES || [None]
| email || text || YES || The email address.
|-
|-
| note || text || YES || [None]
| first_name || text || YES || The first name.
|-
|-
| objective || text || YES || [None]
| initials || text || YES || The initials. Used like a short code for the person.
|-
|-
| row_id || text || YES || [None]
| last_name || text || YES || The last name.
|-
|-
| status || character varying || YES || [None]
| person_id || integer || YES || The ID of the [[#rov.person|person]] in the ROV database.
|-
|-
| summary || text || YES || [None]
| row_id || text || YES || A UUID providing a universally-unique identifier for the entity.
|-
|-
| updated_on || timestamp without time zone || NO || [None]
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|}
|}


<span id="ndst.diveconfig"></span>
<span id="ndst.transects"></span>
=== Table: diveconfig ===
=== Table: transects ===


None
Stores information about each transect.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "diveconfig"
|+ Columns in "transects"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| active || boolean || NO || [None]
| active || boolean || NO || Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
|-
| name || text || YES || [None]
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
|-
|-
| note || text || YES || [None]
| cruise_name || text || YES || The name of the [[#ndst.cruise|cruise]].
|-
|-
| row_id || text || YES || [None]
| dive_name || text || YES || The name of the dive.
|-
|-
| ship_config || text || YES || [None]
| end_time || text || YES || The time of transect ending.
|-
|-
| ship_instrument_configs || text || YES || [None]
| hide || integer || NO || True if the entity should be hidden in the UI.
|-
|-
| sub_config || text || YES || [None]
| leg || text || YES || The leg of the [[#ndst.cruise|cruise]].
|-
|-
| sub_instrument_configs || text || YES || [None]
| name || text || YES || The name of the transect.
|}
 
<span id="ndst.dives"></span>
=== Table: dives ===
 
None
 
{| class="wikitable"
|+ Columns in "dives"
|-
|-
! Name !! Type !! Nullable !! Documentation
| note || text || YES || A note about the transect.
|-
|-
| active || boolean || NO || [None]
| objective || text || YES || The objective of the transect.
|-
|-
| cruise_name || text || YES || [None]
| row_id || text || YES || A UUID providing a universally-unique identifier for the entity.
|-
|-
| dive_config || text || YES || [None]
| start_time || text || YES || The time of transect start.
|-
|-
| end_time || text || YES || [None]
| summary || text || YES || A summary of the transect, its accomplishments, problems, etc.
|-
|-
| leg || text || YES || [None]
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|}
 
<span id="rov"></span>
== Schema: rov ==
 
The main schema of the ROV database, stores information about all relevant entities including cruise metadata, personnel, dives, transects, equipment configuration, telemetry, water properties and observations.
 
<span id="rov.abundance"></span>
=== Table: abundance ===
 
Stores a list of abundance labels from the ACFOR scale.
 
{| class="wikitable"
|+ Columns in "abundance"
|-
|-
| name || text || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| note || text || YES || [None]
| name || character varying || NO || A descriptive label for the abundance level.
|-
|-
| objective || text || YES || [None]
| note || text || YES || An optional note about the abundance level.
|-
|-
| pilot || text || YES || [None]
| rank || integer || YES || A rank used to objectively interpret the abundance label as an ordinal rank. It doesn't matter what the values are so long as they increase monotonically and do not overlap.
|-
|-
| row_id || text || YES || [None]
| short_code || character varying || YES || Contains a short code that can be used to look up an abundance (e.g., during import) without relying on the primary key.
|-
|-
| site_name || text || YES || [None]
| source || character varying || NO || A source label to distinguish abundance labels with the same names. TODO: Provisional, pending determination of how abundance codes are handled.
|-
| start_time || text || YES || [None]
|-
| summary || text || YES || [None]
|}
|}


<span id="ndst.equipconfig"></span>
<span id="rov.annotation_job"></span>
=== Table: equipconfig ===
=== Table: annotation_job ===


None
Stores information about the annotation projects that generate information from photo and video media.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "equipconfig"
|+ Columns in "annotation_job"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| active || boolean || NO || [None]
| created_on || timestamp without time zone || YES || The date of creation of the entity.
|-
|-
| configuration || text || YES || [None]
| end_date || date || YES || The ending date of the project.
|-
|-
| name || text || YES || [None]
| name || character varying || NO || A name for the annotation project.
|-
|-
| note || text || YES || [None]
| note || text || YES || Operational notes about the annotation project.
|-
|-
| row_id || text || YES || [None]
| objective || text || YES || A statement of the objectives of the annotation project.
|-
|-
| short_code || text || YES || [None]
| start_date || date || YES || The starting date of the project.
|-
|-
| type || text || YES || [None]
| updated_on || timestamp without time zone || YES || The date of last modification of the entity.
|}
|}


<span id="ndst.equipment"></span>
<span id="rov.annotation_job_annotation_protocol"></span>
=== Table: equipment ===
=== Table: annotation_job_annotation_protocol ===


None
Associates the annotation job with one or more [[#rov.annotation_protocol|annotation protocols]], which are used to direct annotation activities.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "equipment"
|+ Columns in "annotation_job_annotation_protocol"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| active || boolean || NO || [None]
| annotation_job_id || integer || NO || The ID of the [[#rov.annotation_job|annotation job]].
|-
|-
| brand || text || YES || [None]
| annotation_protocol_id || integer || NO || The ID of the [[#rov.annotation_protocol|annotation protocol]].
|}
 
<span id="rov.annotation_job_crew"></span>
=== Table: annotation_job_crew ===
 
Associates crew members with an [[#rov.annotation_job|annotation job]] with their respective [[#rov.annotation_job_role|roles]].
 
{| class="wikitable"
|+ Columns in "annotation_job_crew"
|-
|-
| instrument_id || integer || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| model || text || YES || [None]
| annotation_job_id || integer || NO || The ID of the [[#rov.annotation_job|annotation job]].
|-
|-
| note || text || YES || [None]
| person_id || integer || NO || The ID of the [[#shared.person|crew member]].
|-
|-
| platform_id || integer || YES || [None]
| role_id || integer || NO || The ID of the [[#rov.annotation_job_role|role]].
|-
| row_id || text || YES || [None]
|-
| serial_number || text || YES || [None]
|-
| short_code || text || YES || [None]
|-
| short_code_mapped || character varying || YES || An optional mapping from the origin short code to an internal short code. Not unique because multiple source items can map to a single internal item.
|-
| type || text || YES || [None]
|}
|}


<span id="ndst.people"></span>
<span id="rov.annotation_job_role"></span>
=== Table: people ===
=== Table: annotation_job_role ===


None
Stores the possible roles one can perform on an [[#rov.annotation_job|annotation job]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "people"
|+ Columns in "annotation_job_role"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| active || boolean || NO || [None]
| name || character varying || NO || The name of the role.
|-
| email || text || YES || [None]
|-
| first_name || text || YES || [None]
|-
| initials || text || YES || [None]
|-
| last_name || text || YES || [None]
|-
| person_id || integer || YES || [None]
|-
|-
| row_id || text || YES || [None]
| note || text || YES || A descript of the role.
|}
|}


<span id="ndst.transects"></span>
<span id="rov.annotation_protocol"></span>
=== Table: transects ===
=== Table: annotation_protocol ===


None
A table to record annotation protocols for annotation projects. Stores information such as the author of the protocol, the observation interval, the medium used and the types of observations to be made.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "transects"
|+ Columns in "annotation_protocol"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| active || boolean || NO || [None]
| algae_species || character varying || YES || Whether all algae species are identified: "all", "subset" or "none".
|-
|-
| cruise_name || text || YES || [None]
| annotation_software_id || integer || NO || Software used to annotate the video or images. Looked up in the [[#rov.annotation_software|annotation software]] table.
|-
|-
| dive_name || text || YES || [None]
| biogenic_habitat || boolean || YES || True if any habitat categories include fauna (e.g., sponge reefs).
|-
|-
| end_time || text || YES || [None]
| created_on || timestamp without time zone || NO || The date of creation of this record.
|-
|-
| leg || text || YES || [None]
| creator_id || integer || YES || Records the identity of the person who created this protocol.
|-
|-
| name || text || YES || [None]
| fish_species || character varying || YES || Whether all fish species are identified: "all", "subset" or "none".
|-
|-
| note || text || YES || [None]
| fov_interval || real || YES || The time interval between field-of-view measurements.
|-
|-
| objective || text || YES || [None]
| fov_interval_unit || character varying || NO || A unit for the field of view interval, such as 's' for seconds or 'm' for metres.
|-
|-
| row_id || text || YES || [None]
| habitat_interval || real || YES || The time interval between habitat observations.
|-
|-
| start_time || text || YES || [None]
| habitat_interval_unit || character varying || NO || A unit for the habitat interval, such as 's' for seconds or 'm' for metres.
|-
|-
| summary || text || YES || [None]
| habitat_only || boolean || YES || Set to true if only habitat variables were recorded.
|}
 
== Schema: obis ==
 
<span id="obis"></span>
<span id="obis.taxon"></span>
=== Table: taxon ===
 
OBIS taxonomy records imported directly from the OBIS observation data, but filtered for uniqueness on the Aphia ID.
 
{| class="wikitable"
|+ Columns in "taxon"
|-
|-
! Name !! Type !! Nullable !! Documentation
| image_interval || real || YES || The interval between images or frame grabs. Typically 3 to 10 seconds.
|-
|-
| aphiaid || integer || NO || [None]
| image_interval_unit || character varying || NO || A unit for the image interval, such as 's' for seconds or 'm' for metres.
|-
|-
| class || character varying || YES || [None]
| image_overlap || boolean || YES || Is there overlap between the images (true) or do they represent independent non-overlapping space (false).
|-
|-
| domain || character varying || YES || [None]
| invertebrate_species || character varying || YES || Whether all invertebrate species are identified: "all", "subset" or "none".
|-
|-
| family || character varying || YES || [None]
| is_template || boolean || YES || If this is meant to be a template that is copied for use, mark this column `true`.
|-
|-
| forma || character varying || YES || [None]
| medium_type_id || integer || NO || The type of media used for annotation. Looked up in [[#rov.medium_type|media type]] table.
|-
|-
| genus || character varying || YES || [None]
| name || character varying || NO || The name of the annotation protocol. Should be unique.
|-
|-
| gigaclass || character varying || YES || [None]
| note || text || YES || If only a subset of invert, fish or algae species were identified, note here which groups were the primary focus (target species). For example, benthic fish or corals and sponges. Also for other notes of interest.
|-
|-
| infraclass || character varying || YES || [None]
| observation_interval || real || YES || The time interval between species or anthropogenic observations.
|-
|-
| infrakingdom || character varying || YES || [None]
| observation_interval_unit || character varying || NO || A unit for the observation interval, such as 's' for seconds or 'm' for metres.
|-
|-
| infraorder || character varying || YES || [None]
| protocol_document || character varying || YES || Link, title, DOI, etc. of a document describing the protocol in full.
|-
|-
| infraphylum || character varying || YES || [None]
| species_guide || character varying || YES || A URL to the iNaturalist species guide that was used for annotation.
|-
|-
| kingdom || character varying || YES || [None]
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
 
<span id="rov.annotation_protocol_document"></span>
=== Table: annotation_protocol_document ===
 
Contains documents related to an [[#rov.annotation_protocol|annotation protocol]]. These can be a URL or actual file data. If the file data are present in the database, the URL can still be used to provide the origin of the file, etc.
 
{| class="wikitable"
|+ Columns in "annotation_protocol_document"
|-
|-
| megaclass || character varying || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| natio || character varying || YES || [None]
| annotation_protocol_id || integer || NO || A reference to the [[#rov.annotation_protocol|annotation protocol]].
|-
|-
| order || character varying || YES || [None]
| created_on || timestamp without time zone || NO || The time of creation of the record.
|-
|-
| organismname || character varying || YES || [None]
| file_id || integer || YES || A reference to the [[#shared.uploaded_file|uploaded file]].
|-
|-
| originalscientificname || character varying || YES || [None]
| note || text || YES || An optional note about the document.
|-
|-
| parvorder || character varying || YES || [None]
| title || character varying || NO || The title of the document.
|-
|-
| parvphylum || character varying || YES || [None]
| updated_on || timestamp without time zone || NO || The time of update of the record.
|-
|-
| phylum || character varying || YES || [None]
| url || character varying || YES || An optional URL for the document. If file data are not given, this field is required.
|}
 
<span id="rov.annotation_software"></span>
=== Table: annotation_software ===
 
The software used for annotation.
 
{| class="wikitable"
|+ Columns in "annotation_software"
|-
|-
| phylum_division || character varying || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| scientificname || character varying || NO || [None]
| name || character varying || NO || The name of the annotation software.
|-
|-
| section || character varying || YES || [None]
| note || text || YES || An optional note about the annotation software.
|}
 
<span id="rov.biigle_label_map"></span>
=== Table: biigle_label_map ===
 
Contains mappings from Biigle labels to properties that apply to events.
 
{| class="wikitable"
|+ Columns in "biigle_label_map"
|-
|-
| series || character varying || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| species || character varying || YES || [None]
| created_on || timestamp without time zone || NO || The time of creation of the record.
|-
|-
| subclass || character varying || YES || [None]
| label_hierarchy || text || NO || The full hierarchical text of the Biigle label.
|-
|-
| subfamily || character varying || YES || [None]
| label_id || integer || NO || The ID of the Biigle label.
|-
|-
| subforma || character varying || YES || [None]
| label_text || text || NO || The text of the final element of the label.
|-
|-
| subgenus || character varying || YES || [None]
| label_tree_id || integer || NO || The ID of the Biigle label tree.
|-
|-
| subkingdom || character varying || YES || [None]
| note || text || YES || A textual note or comment.
|-
|-
| suborder || character varying || YES || [None]
| properties || jsonb || NO || Stores the properties of the observation.
|-
|-
| subphylum || character varying || YES || [None]
| updated_on || timestamp without time zone || NO || Time of last update of the record.
|}
 
<span id="rov.biigle_label_map_restriction"></span>
=== Table: biigle_label_map_restriction ===
 
Links a [[#rov.biigle_label_map|Biigle label map]] to a [restriction][#shared.restriction].
 
{| class="wikitable"
|+ Columns in "biigle_label_map_restriction"
|-
|-
| subphylum_subdivision || character varying || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| subsection || character varying || YES || [None]
| biigle_label_map_id || integer || NO || A link to the [[#rov.biigle_label_map|label map]].
|-
|-
| subspecies || character varying || YES || [None]
| restriction_id || integer || NO || A link to the [[#shared.restriction|restriction]].
|-
|}
| subterclass || character varying || YES || [None]
 
|-
<span id="rov.biocover"></span>
| subtribe || character varying || YES || [None]
=== Table: biocover ===
|-
 
| subvariety || character varying || YES || [None]
A lookup table listing the available biocover types for the [[#rov.habitat_event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity. TODO: Should perhaps refer to the [[#shared.taxon|taxon]] table.
|-
 
| superclass || character varying || YES || [None]
{| class="wikitable"
|+ Columns in "biocover"
|-
|-
| superdomain || character varying || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| superfamily || character varying || YES || [None]
| name || character varying || NO || The name of the biocover.
|-
|-
| superorder || character varying || YES || [None]
| note || text || YES || An optional description of the biocover.
|-
|-
| supertribe || character varying || YES || [None]
| short_code || character varying || YES || Contains a short code that can be used to look up a biocover (e.g., during import) without relying on the primary key.
|}
 
<span id="rov.complexity"></span>
=== Table: complexity ===
 
A lookup table listing the available habitat complexity types for the [[#rov.habitat_event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
 
{| class="wikitable"
|+ Columns in "complexity"
|-
|-
| taxonid || character varying || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| taxonomicstatus || character varying || YES || [None]
| name || character varying || NO || The name of the complexity type.
|-
|-
| taxonrank || character varying || YES || [None]
| note || text || YES || An optional description of the complexity type.
|-
|-
| taxonremarks || text || YES || [None]
| short_code || character varying || YES || Contains a short code that can be used to look up a complexity (e.g., during import) without relying on the primary key.
|-
| tribe || character varying || YES || [None]
|-
| type || character varying || YES || [None]
|-
| variety || character varying || YES || [None]
|-
| vernacularname || character varying || YES || [None]
|}
|}


== Schema: pa ==
<span id="rov.coverage"></span>
=== Table: coverage ===


<span id="pa"></span>
A lookup table listing the percentage of coverage for the [[#rov.habitat_event|habitat_event]] table. The coverages are given as ranges so the text of the level is given in the name field and the values in the min and max fields contain the bounding values.
<span id="pa.mpa"></span>
=== Table: mpa ===
 
None


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "mpa"
|+ Columns in "coverage"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| aichi_t11 || character varying || YES || [None]
| maximum || real || NO || The minimum value in the range.
|-
|-
| biome || character varying || YES || [None]
| minimum || real || NO || The minimum value in the range.
|-
|-
| comments || character varying || YES || [None]
| name || character varying || NO || A characterization of percent coverage. Presented as a range of percentages.
|-
|-
| delisdate || integer || YES || [None]
| note || text || YES || An optional note about the coverage percentage.
|-
|-
| geom || geometry || YES || [None]
| short_code || character varying || YES || Contains a short code that can be used to look up a coverage (e.g., during import) without relying on the primary key.
|}
 
<span id="rov.cruise"></span>
=== Table: cruise ===
 
Cruise legs occur within a [[#rov.cruise|cruise]] and are assigned specific [[#rov.cruise_leg_crew|crews]], [[#rov.program|scientific programs]], etc. A single leg can cover an entire cruise, legs can be spaced end-to-end, or can theoretically overlap. Legs can share members or equipment, and crew members can have specific roles related to a leg. Cruise legs can be created without a [[#rov.program|scientific program]] or a [[#rov.cruise|cruise]] because imported data sets may only list the name of the cruise and not indicate whether it was part of a longer cruise.
 
{| class="wikitable"
|+ Columns in "cruise"
|-
|-
| geometry || USER-DEFINED || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| gov_type || character varying || YES || [None]
| admin_note || text || YES || Notes by the database administrator about this entity.
|-
|-
| iucn_cat || character varying || YES || [None]
| approved || integer || NO || If zero, the record is not approved and should not be shown or used. Currently a non-zero value represents approval, but may be expanded to various levels of approval in the future.
|-
|-
| jur_id || character varying || YES || [None]
| created_on || timestamp without time zone || NO || The date of creation of this record.
|-
|-
| legisl_e || character varying || YES || [None]
| end_time || timestamp without time zone || YES || The end time of the leg.
|-
|-
| legisl_f || character varying || YES || [None]
| leg || integer || NO || Cruise legs are numbered from 1.
|-
|-
| loc_e || character varying || YES || [None]
| mark_for_delete || boolean || NO || Marks the entity for asynchronous deletion by the runner.
|-
|-
| loc_f || character varying || YES || [None]
| name || character varying || NO || A name for this leg of the cruise.
|-
|-
| mgmt_e || character varying || YES || [None]
| note || text || YES || Notes about the cruise.
|-
|-
| mgmt_f || character varying || YES || [None]
| objective || text || YES || A statement of the operational or scientific objectives of the cruise.
|-
|-
| name_e || character varying || YES || [None]
| planned_track || USER-DEFINED || YES || A multilinestring containing the planned track of the leg. TODO: Not known whether this is necessary.
|-
|-
| name_f || character varying || YES || [None]
| ship_id || integer || NO || The ID of the [[#rov.platform|ship]] used on this cruise.
|-
|-
| name_ind || character varying || YES || [None]
| start_time || timestamp without time zone || NO || The start time of the leg.
|-
|-
| o_area || double precision || YES || [None]
| summary || text || YES || A summary of the cruise, with information about whether the objectives were met and any other pertinent information.
|-
|-
| objectid || bigint || NO || [None]
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
 
<span id="rov.cruise_crew"></span>
=== Table: cruise_crew ===
 
Associates [[#rov.person|crew members]] with a [[#rov.cruise_leg|cruise leg]] and their [[#rov.cruise_role|roles]]. A crew member can have multiple roles. Note: these roles are distinct from members of [[#rov.program|programs]], such as Chief Scientist. It may be necessary to revisit this structure or the division of roles.
 
{| class="wikitable"
|+ Columns in "cruise_crew"
|-
|-
| oecm || character varying || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| ogc_fid || integer || NO || [None]
| cruise_id || integer || NO || Reference to the [[#rov.cruise_leg|cruise leg]] to which the member is assigned.
|-
|-
| owner_e || character varying || YES || [None]
| cruise_role_id || integer || NO || Reference to the [[#rov.cruise_role|cruise role]].
|-
|-
| owner_f || character varying || YES || [None]
| note || text || YES || An optional note about the crew member.
|-
|-
| parent_id || integer || YES || [None]
| person_id || integer || NO || Reference to the [[#rov.person|person]] on the crew.
|-
| protdate || integer || YES || [None]
|-
| shape_area || double precision || YES || [None]
|-
| shape_length || double precision || YES || [None]
|-
| status_e || character varying || YES || [None]
|-
| status_f || character varying || YES || [None]
|-
| subs_right || character varying || YES || [None]
|-
| type_e || character varying || YES || [None]
|-
| type_f || character varying || YES || [None]
|-
| url || character varying || YES || [None]
|-
| zone_id || integer || YES || [None]
|-
| zonedesc_e || character varying || YES || [None]
|-
| zonedesc_f || character varying || YES || [None]
|}
|}


<span id="pa.mpa_data_object"></span>
<span id="rov.cruise_document"></span>
=== Table: mpa_data_object ===
=== Table: cruise_document ===


A data object related to an [[#mpa.mpa|MPA]]. This is the abstract, or top-level object, which may contain one or more physical objects (files) or documents.
Stores information about documents related to a [[#rov.cruise|cruise]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "mpa_data_object"
|+ Columns in "cruise_document"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
|-
|-
| description || text || YES || A description of the object.
| cruise_id || integer || NO || The ID of the [[#rov.cruise|cruise]].
|-
|-
| doi || character varying || YES || The DOI of the object.
| file_id || integer || YES || [None]
|-
|-
| isbn || character varying || YES || The ISBN of the object.
| note || text || YES || A note about the document.
|-
|-
| mpa_id || integer || NO || A reference to the [[#mpa.mpa|MPA]] record.
| title || character varying || NO || The title of the document.
|-
|-
| name || character varying || NO || The name of the data object.
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|-
|-
| updated_on || timestamp without time zone || NO || The last update time of the object.
| url || character varying || YES || A URL for the online copy of the document. May be used when no file is available.
|}
|}


<span id="pa.mpa_data_object_file"></span>
<span id="rov.cruise_fn_contact"></span>
=== Table: mpa_data_object_file ===
=== Table: cruise_fn_contact ===


Gives the ability for more than one [[#mpa.data_object|data object]] to own a [[#shared.file|file]] and vice versa.
A table for associating First Nations contacts with a cruise.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "mpa_data_object_file"
|+ Columns in "cruise_fn_contact"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| data_object_id || integer || NO || A reference to the [[#mpa.data_object|data object]].
| contact_name || character varying || NO || The full name of the contact.
|-
|-
| file_id || integer || NO || A reference to the [[#shared.file|file]].
| cruise_id || integer || NO || A reference to the [[#rov.cruise|cruise]].
|-
| email || character varying || YES || The email address of the contact.
|-
| nation || text || YES || The name of the nation or group represented by the contact.
|-
| note || text || YES || A note about the contact.
|-
| phone || character varying || YES || The phone number of the contact.
|}
|}


<span id="pa.protected_area"></span>
<span id="rov.cruise_import"></span>
=== Table: protected_area ===
=== Table: cruise_import ===


A unified table for protected areas.
Stores cruise import tasks in the database. These contain the JSON data description, a status message and complete processing log.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "protected_area"
|+ Columns in "cruise_import"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| area || real || YES || The nominal area in sq. km of the protected area.
| created_on || timestamp without time zone || YES || [None]
|-
|-
| geom || geometry || NO || The boundary geometry of the protected area.
| data || jsonb || NO || A JSON document containing the cruise import data.
|-
|-
| name_e || character varying || NO || The English name of the protected area.
| logs || jsonb || NO || A JSON array containing the complete processing log.
|-
|-
| name_f || character varying || NO || The French name of the protected area.
| name || character varying || NO || A unique name for the import job.
|-
|-
| note || text || YES || An optional note about the protected area.
| status || character varying || NO || A status message about processing.
|-
|-
| original_id || integer || YES || The original ID of the protected area, from the source database.
| updated_on || timestamp without time zone || YES || [None]
|-
|-
| type || character varying || NO || The type of protected area, including "RCA", "MPA", etc.
| version || integer || NO || [None]
|-
| year_created || integer || YES || The year of creation of the protected area.
|}
|}


<span id="pa.protected_area_data_object"></span>
<span id="rov.cruise_library"></span>
=== Table: protected_area_data_object ===
=== Table: cruise_library ===


A data object related to an [[#rca.rca|RCA]]. This is the abstract, or top-level object, which may contain one or more physical objects (files) or documents.
This table creates an association between a [[#rov.cruise_leg|cruise leg]] and [[#rov.library|documents in the library]] that may be relevant to its research objectives.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "protected_area_data_object"
|+ Columns in "cruise_library"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
| cruiseleg_id || integer || NO || A reference to the [[#rov.cruise_leg|cruise leg]].
|-
|-
| description || text || YES || A description of the object.
| library_id || integer || NO || A reference to the document in the [[#rov.library|library]].
|-
|-
| doi || character varying || YES || The DOI of the object.
| note || text || YES || An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc.
|}
 
<span id="rov.cruise_program"></span>
=== Table: cruise_program ===
 
A table to link [[#rov.program|programs]] and [[#rov.cruise|cruises]]. A cruise can be under the auspices of more than one program or none.
 
{| class="wikitable"
|+ Columns in "cruise_program"
|-
|-
| isbn || character varying || YES || The ISBN of the object.
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the data object.
| cruise_id || integer || NO || The ID of a [[#rov.cruise|cruise]].
|-
|-
| protected_area_id || integer || YES || A link to the [[#pa.protected_area|protected area]].
| program_id || integer || NO || The ID of a [[#rov.program|program]].
|-
| updated_on || timestamp without time zone || NO || The last update time of the object.
|}
|}


<span id="pa.protected_area_data_object_file"></span>
<span id="rov.cruise_role"></span>
=== Table: protected_area_data_object_file ===
=== Table: cruise_role ===


Gives the ability for more than one [[#rca.data_object|data object]] to own a [[#shared.file|file]] and vice versa.
A lookup table of roles available to members of [[#rov.cruise_leg_crew|cruise leg crews]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "protected_area_data_object_file"
|+ Columns in "cruise_role"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| data_object_id || integer || NO || A reference to the [[#rca.data_object|data object]].
| name || character varying || NO || The name of the role.
|-
|-
| file_id || integer || NO || A reference to the [[#shared.file|file]].
| note || text || YES || An optional note about the role and its responsibilities.
|-
| short_code || character varying || YES || A short string used to identify the role.
|}
|}


<span id="pa.rca"></span>
<span id="rov.disturbance"></span>
=== Table: rca ===
=== Table: disturbance ===


Stores basic information about RCAs along with a boundary geometry.
Provides a nominal level of disturbance for [[#rov.habitat_event|habitat events]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "rca"
|+ Columns in "disturbance"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| area || real || YES || The area of the RCA (from source).
| name || character varying || NO || The textual representation of the disturbance level.
|-
|-
| description || text || YES || A description of the RCA.
| note || text || YES || A note about the disturbance level.
|-
|-
| formerid || smallint || YES || The former ID of the RCA (from source).
| short_code || character varying || YES || Contains a short code that can be used to look up a disturbance (e.g., during import) without relying on the primary key.
|}
 
<span id="rov.dive"></span>
=== Table: dive ===
 
A dive is what an ROV does. The dive has a start and end time (not necessarily submerge/resurface), a [[#rov.dive_crew|crew]] and possibly a name. [[#rov.transect|Transects]] occur during dives.
 
{| class="wikitable"
|+ Columns in "dive"
|-
|-
| geom || geometry || YES || The RCA geography.
! Name !! Type !! Nullable !! Documentation
|-
|-
| hectares || real || YES || The number of hectares in the RCA (from source).
| admin_note || text || YES || [None]
|-
|-
| len || real || YES || The length (?) of the RCA (from source).
| attributes || jsonb || YES || A JSON column used for recording structured attributes that do not fit with the regular table structure.
|-
|-
| name || character varying || YES || The name of the RCA.
| created_on || timestamp without time zone || NO || The date of creation of this record.
|-
|-
| rca_id || double precision || YES || The RCA ID as defined by the provider.
| cruise_id || integer || NO || A reference to the [[#rov.cruise_leg|cruise leg]] during which the dive was performed.
|-
|-
| sq_km || real || YES || The area of the RCA (from source).
| end_time || timestamp without time zone || NO || The end of the dive.
|-
|-
| yr_created || smallint || YES || The year the RCA was created (from source).
| mark_for_delete || boolean || NO || Marks the entity for asynchronous deletion by the runner.
|}
 
== Schema: rov ==
 
<span id="rov"></span>
<span id="rov.abundance"></span>
=== Table: abundance ===
 
Stores a list of abundance labels from the ACFOR scale.
 
{| class="wikitable"
|+ Columns in "abundance"
|-
|-
! Name !! Type !! Nullable !! Documentation
| name || character varying || NO || A name for the dive.
|-
|-
| name || character varying || NO || A descriptive label for the abundance level.
| note || text || YES || An optional note about the dive.
|-
|-
| note || text || YES || An optional note about the abundance level.
| objective || text || YES || A statement of the practical or research objectives for this dive.
|-
|-
| rank || integer || YES || A rank used to objectively interpret the abundance label as an ordinal rank. It doesn't matter what the values are so long as they increase monotonically and do not overlap.
| seatube_id || integer || YES || The ID of a dive on SeaTube corresponding to this dive.
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up an abundance (e.g., during import) without relying on the primary key.
| ship_config_id || integer || NO || A reference to the [[#rov.platform_config|platform config]] for the ship.
|-
|-
| source || character varying || NO || A source label to distinguish abundance labels with the same names. TODO: Provisional, pending determination of how abundance codes are handled.
| site || character varying || YES || An optional name for the site.
|-
| start_time || timestamp without time zone || NO || The start of the dive. Not necessarily the time the vehicle is placed in the water.
|-
| sub_config_id || integer || NO || A reference to the [[#rov.platform_config|platform config]] for the submersible or ROV.
|-
| summary || text || YES || A summary of the [[#rov.dive|dive]]; whether objectives were met, problems encountered, etc.
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
|}


<span id="rov.annotation_protocol"></span>
<span id="rov.dive_crew"></span>
=== Table: annotation_protocol ===
=== Table: dive_crew ===


A table to record annotation protocols for annotation [[#rov.project|projects]]. TODO: Currently under development as a concept. The idea is to develop the protocol and mark it as a template. Users will create [[#rov.project|projects]] and either associate them with a template protocol or copy and edit the protocol and use the copy. Any protocol can be marked as a template for future use. The template concept is largely a convenience.
Assigns roles to dive crew members. Crew members are selected from the [[#rov.person|person]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "annotation_protocol"
|+ Columns in "dive_crew"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| algae_species || character varying || YES || Whether all algae species are identified: "all", "subset" or "none".
| dive_id || integer || NO || The [[#rov.dive|dive]] to which the crew member is assigned.
|-
|-
| annotation_software_id || integer || NO || Software used to annotate the video or images. Looked up in the [[#rov.annotation_software|annotation software]] table.
| dive_role_id || integer || NO || A reference to the [[#rov.dive_role|dive role]].
|-
|-
| biogenic_habitat || boolean || YES || True if any habitat categories include fauna (e.g., sponge reefs).
| note || text || YES || An optional note about the crew member.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| person_id || integer || NO || A reference to the [[#rov.person|person]].
|}
 
<span id="rov.dive_role"></span>
=== Table: dive_role ===
 
A list of roles available to crew members on a [[#rov.dive|dive]] via the [[#rov.dive_crew|dive_crew]] table.
 
{| class="wikitable"
|+ Columns in "dive_role"
|-
|-
| creator_id || integer || YES || Records the identity of the person who created this protocol.
! Name !! Type !! Nullable !! Documentation
|-
|-
| fish_species || character varying || YES || Whether all fish species are identified: "all", "subset" or "none".
| name || character varying || NO || The name of the role.
|-
|-
| fov_interval || real || YES || [None]
| note || text || YES || An optional description of the role.
|-
|-
| fov_interval_unit || character varying || NO || A unit for the field of view interval, such as 's' for seconds or 'm' for metres.
| short_code || character varying || YES || A short string used to identify the role.
|}
 
<span id="rov.equipment_type"></span>
=== Table: equipment_type ===
 
This is a lookup table to provide the names of types of equipment for the [[#rov.model_equipment_type|model_equipment_type]] table, e.g., "Digital Still Camera", "Thermometer," "ROV," etc.
 
{| class="wikitable"
|+ Columns in "equipment_type"
|-
|-
| habitat_interval || real || YES || [None]
! Name !! Type !! Nullable !! Documentation
|-
|-
| habitat_interval_unit || character varying || NO || A unit for the habitat interval, such as 's' for seconds or 'm' for metres.
| category || USER-DEFINED || YES || An enumeration column identifying the equipment as platform, instrument or some other type.
|-
|-
| habitat_only || boolean || YES || Set to true if only habitat variables were recorded.
| name || character varying || NO || A name for the equipment type.
|-
|-
| image_interval || real || YES || The interval between images or frame grabs. Typically 3 to 10 seconds.
| note || text || YES || An optional note about the equipment type.
|}
 
<span id="rov.event"></span>
=== Table: event ===
 
The event table, a schemaless table storing all recorded observations and statuses during operations.
 
{| class="wikitable"
|+ Columns in "event"
|-
|-
| image_interval_unit || character varying || NO || A unit for the image interval, such as 's' for seconds or 'm' for metres.
! Name !! Type !! Nullable !! Documentation
|-
|-
| image_overlap || boolean || YES || Is there overlap between the images (true) or do they represent independent non-overlapping space (false).
| annotation_job_id || integer || YES || [None]
|-
|-
| invertebrate_species || character varying || YES || Whether all invertebrate species are identified: "all", "subset" or "none".
| created_on || timestamp without time zone || NO || The time of creation of the event.
|-
|-
| is_template || boolean || NO || If this is meant to be a template that is copied for use, mark this column `true`.
| dive_id || integer || NO || A reference to the dive during which this event occurred.
|-
|-
| medium_type_id || integer || NO || The type of media used for annotation. Looked up in [[#rov.medium_type|media type]] table.
| end_time || timestamp without time zone || YES || The end time of the event. Null, if the event is discrete.
|-
|-
| name || character varying || NO || The name of the annotation protocol. Should be unique.
| hidden || boolean || NO || If true, the entity should be hidden from searches and reports. An alternative to deleting entities that may prove useful in the future.
|-
|-
| note || text || YES || If only a subset of invert, fish or algae species were identified, note here which groups were the primary focus (target species). For example, benthic fish or corals and sponges. Also for other notes of interest.
| instrument_config_id || integer || YES || [None]
|-
|-
| observation_interval || real || YES || [None]
| note || text || YES || An optional note about the event. Do not use to store event data.
|-
|-
| observation_interval_unit || character varying || NO || A unit for the observation interval, such as 's' for seconds or 'm' for metres.
| properties || jsonb || NO || A JSON object containing name-value pairs describing the event.
|-
|-
| protocol_document || character varying || YES || Link, title, DOI, etc. of a document describing the protocol in full.
| restriction_mask || bit || NO || [None]
|-
|-
| species_guide || character varying || YES || A URL to the iNaturalist species guide that was used for annotation.
| start_time || timestamp without time zone || NO || The start time of the event.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
| updated_on || timestamp without time zone || NO || The time of update of the event. Automatically updated by a trigger.
|}
|}


<span id="rov.annotation_protocol_document"></span>
<span id="rov.event_logger"></span>
=== Table: annotation_protocol_document ===
=== Table: event_logger ===


Contains documents related to an [[rov.annotation_protocol annotation protocol]]. These can be a URL or actual file data. If the file data are present in the database, the URL can still be used to provide the origin of the file, etc.
This table tracks the [[#shared.person|people]] who contributed to annotation, which may be composed of a number of separate labels.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "annotation_protocol_document"
|+ Columns in "event_logger"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| annotation_protocol_id || integer || NO || A reference to the [[#rov.annotation_protocol|annotation protocol]].
| event_id || integer || NO || The [[#rov.event|event]] that was created from the annotation(s).
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
| person_id || integer || NO || A [[#shared.person|person]] who contributed to the annotation.
|}
 
<span id="rov.flow"></span>
=== Table: flow ===
 
Stores categories of current flow for [[#rov.habitat_event|habitat]].
 
{| class="wikitable"
|+ Columns in "flow"
|-
|-
| file_name || character varying || YES || The original name of the document file.
! Name !! Type !! Nullable !! Documentation
|-
|-
| file_type || character varying || YES || The [https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types mime type] of the file. Required if file data are given.
| name || character varying || NO || A note about the flow category.
|-
|-
| note || text || YES || An optional note about the document.
| note || text || YES || [None]
|-
|-
| title || character varying || NO || The title of the document.
| short_code || character varying || YES || A short code for the flow category.
|-
| updated_on || timestamp without time zone || NO || The time of update of the record.
|-
| url || character varying || YES || An optional URL for the document. If file data are not given, this field is required.
|}
|}


<span id="rov.annotation_software"></span>
<span id="rov.generic_label_map"></span>
=== Table: annotation_software ===
=== Table: generic_label_map ===


The software used for annotation.
A table for storing mappings from annotation labels to property sets.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "annotation_software"
|+ Columns in "generic_label_map"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the annotation software.
| created_on || timestamp without time zone || NO || The date of creation.
|-
| label_text || USER-DEFINED || NO || The text of the label.
|-
| note || text || YES || A note about the mapping.
|-
|-
| note || text || YES || An optional note about the annotation software.
| properties || jsonb || NO || A dictionary of mapped properties.
|-
|-
| short_code || character || NO || Provides a short code for looking up the entity.
| updated_on || timestamp without time zone || NO || The date of last update.
|}
|}


<span id="rov.biocover"></span>
<span id="rov.generic_label_map_restriction"></span>
=== Table: biocover ===
=== Table: generic_label_map_restriction ===


A lookup table listing the available biocover types for the [[#rov.habitat_event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity. TODO: Should perhaps refer to the [[#shared.taxon|taxon]] table.
Links a [[#rov.generic_label_map|generic label mapping]] to a [[#shared.restriction|restriction]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "biocover"
|+ Columns in "generic_label_map_restriction"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the biocover.
| generic_label_map_id || integer || NO || A reference to a [[#rov.generic_label_map|generic label mapping]].
|-
|-
| note || text || YES || An optional description of the biocover.
| restriction_id || integer || NO || A reference to a [[#shared.restriction|restriction]].
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a biocover (e.g., during import) without relying on the primary key.
|}
|}


<span id="rov.comment_event"></span>
<span id="rov.image_quality"></span>
=== Table: comment_event ===
=== Table: image_quality ===


Provides a way to record comments rather than using a sparse note field on the [[#rov.table|event]].
Nominal image quality levels, originally used by VideoMiner but applicable to new records.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "comment_event"
|+ Columns in "image_quality"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| event_id || integer || NO || A reference to the [[#rov.event|parent event]].
| name || character varying || NO || A name for the quality level.
|-
| note || text || YES || An optional note.
|-
|-
| note || text || YES || A text comment or note.
| rank || integer || YES || An ordinal rank (zero is high) for the quality level.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up an image quality (e.g., during import) without relying on the primary key.
|}
|}


<span id="rov.complexity"></span>
<span id="rov.import_queue_annotator"></span>
=== Table: complexity ===
=== Table: import_queue_annotator ===


A lookup table listing the available habitat complexity types for the [[#rov.habitat_event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
Stores the import packages created by annotators. Some fields are transferred to the [[#rov.annotation_job|annotation job]] to record the objectives of the project. Each queue item (and therefore each job) should correspond to a single annotation project, and not encompass multiple projects with different objectives.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "complexity"
|+ Columns in "import_queue_annotator"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the complexity type.
| created_on || timestamp without time zone || NO || The date of creation of the record.
|-
| cruise_name || character varying || NO || The name of the [[#rov.cruise|cruise]] to which this record is linked. A lookup is not used because the cruise record may not have been created yet.
|-
|-
| note || text || YES || An optional description of the complexity type.
| data || jsonb || NO || Stores the JSON representation of the import job.
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a complexity (e.g., during import) without relying on the primary key.
| end_date || date || YES || [None]
|}
|-
 
| hidden || boolean || NO || [None]
<span id="rov.coverage"></span>
|-
=== Table: coverage ===
| name || character varying || NO || A unique name for the import queue record.
 
A lookup table listing the percentage of coverage for the [[#rov.habitat_event|habitat_event]] table. The coverages are given as ranges so the text of the level is given in the name field and the values in the min and max fields contain the bounding values.
 
{| class="wikitable"
|+ Columns in "coverage"
|-
|-
! Name !! Type !! Nullable !! Documentation
| note || text || YES || An optional note about the import package.
|-
|-
| maximum || real || NO || The minimum value in the range.
| objective || text || YES || [None]
|-
|-
| minimum || real || NO || The minimum value in the range.
| start_date || date || YES || [None]
|-
|-
| name || character varying || NO || A characterization of percent coverage. Presented as a range of percentages.
| status || character varying || YES || A short description of the processing status of the job.
|-
|-
| note || text || YES || An optional note about the coverage percentage.
| updated_on || timestamp without time zone || NO || The date of update of the record.
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a coverage (e.g., during import) without relying on the primary key.
| user_id || integer || NO || A reference to the [[#shared.mseauser|MSEA user]] that created the record.
|}
|}


<span id="rov.cruise"></span>
<span id="rov.import_queue_annotator_label_map_prefill"></span>
=== Table: cruise ===
=== Table: import_queue_annotator_label_map_prefill ===


Cruise legs occur within a [[#rov.cruise|cruise]] and are assigned specific [[#rov.cruise_leg_crew|crews]], [[#rov.program|scientific programs]], etc. A single leg can cover an entire cruise, legs can be spaced end-to-end, or can theoretically overlap. Legs can share members or equipment, and crew members can have specific roles related to a leg. Cruise legs can be created without a [[#rov.program|scientific program]] or a [[#rov.cruise|cruise]] because imported data sets may only list the name of the cruise and not indicate whether it was part of a longer cruise.
A table to store the last configured tags and values for labels. Provides pre-filling in label mapping application.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "cruise"
|+ Columns in "import_queue_annotator_label_map_prefill"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| approved || integer || NO || If zero, the record is not approved and should not be shown or used. Currently a non-zero value represents approval, but may be expanded to various levels of approval in the future.
| created_on || timestamp without time zone || YES || The date and time of creation of the entity.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| event_type || jsonb || YES || [None]
|-
|-
| end_time || timestamp without time zone || YES || The end time of the leg.
| label_tree_name || character varying || YES || The label tree name. If given identifies the label uniquely with the tree name.
|-
|-
| leg || integer || NO || Cruise legs are numbered from 1.
| name || character varying || NO || The text of the label.
|-
|-
| name || character varying || NO || A name for this leg of the cruise.
| properties || jsonb || NO || The the tag data.
|-
|-
| note || text || YES || Notes about the cruise.
| tags || jsonb || NO || The list of tags.
|-
|-
| objective || text || YES || A statement of the operational or scientific objectives of the cruise.
| updated_on || timestamp without time zone || YES || The date and time of the entity's last update.
|-
| planned_track || USER-DEFINED || YES || A multilinestring containing the planned track of the leg. TODO: Not known whether this is necessary.
|-
| ship_id || integer || NO || [None]
|-
| start_time || timestamp without time zone || NO || The start time of the leg.
|-
| summary || text || YES || A summary of the cruise, with information about whether the objectives were met and any other pertinent information.
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
|}


<span id="rov.cruise_crew"></span>
<span id="rov.import_queue_pi"></span>
=== Table: cruise_crew ===
=== Table: import_queue_pi ===


Associates [[#rov.person|crew members]] with a [[#rov.cruise_leg|cruise leg]] and their [[#rov.cruise_role|roles]]. A crew member can have multiple roles. Note: these roles are distinct from members of [[#rov.program|programs]], such as Chief Scientist. It may be necessary to revisit this structure or the division of roles.
Stores the import packages created by principal investigators.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "cruise_crew"
|+ Columns in "import_queue_pi"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| cruise_id || integer || NO || Reference to the [[#rov.cruise_leg|cruise leg]] to which the member is assigned.
| created_on || timestamp without time zone || NO || The date of creation of the record.
|-
| cruise_id || integer || NO || A reference to the [[#rov.cruise|cruise]].
|-
| hidden || boolean || NO || [None]
|-
|-
| cruise_role_id || integer || NO || Reference to the [[#rov.cruise_role|cruise role]].
| name || character varying || NO || A name of the import job
|-
|-
| note || text || YES || An optional note about the crew member.
| note || text || YES || An optional note about the import package.
|-
|-
| person_id || integer || NO || Reference to the [[#rov.person|person]] on the crew.
| status || character varying || YES || A short description of the processing status of the job.
|}
|-
 
| updated_on || timestamp without time zone || NO || The date of update of the record.
<span id="rov.cruise_document"></span>
|-
=== Table: cruise_document ===
| user_id || integer || NO || A reference to the [[#shared.mseauser|MSEA user]] that created the record.
|}


None
<span id="rov.instrument"></span>
=== Table: instrument ===
 
This table represents instruments, which are concrete instances of the types represented in the [[#rov.model|model]] table. instruments tend to be things that generate data, be it a thermometer or a camera. For the purposes of this database, an instrument is anything that is not a [[#rov.platform|platform]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "cruise_document"
|+ Columns in "instrument"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| created_on || timestamp without time zone || NO || [None]
| attributes || jsonb || YES || A freeform list of attributes for this instrument.
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
|-
|-
| cruise_id || integer || NO || [None]
| model_id || integer || NO || A reference to the instrument [[#rov.model|model]].
|-
|-
| file_name || character varying || YES || [None]
| name || character varying || YES || A name for the instrument to distinguish it from others of the same model.
|-
|-
| file_type || character varying || YES || [None]
| note || text || YES || An optional note about this instrument.
|-
|-
| note || text || YES || [None]
| organisation_id || integer || NO || A reference to the organisation that owns and operates the instrument.
|-
|-
| title || character varying || NO || [None]
| retired || date || YES || If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active.
|-
|-
| updated_on || timestamp without time zone || NO || [None]
| serial_number || character varying || NO || The serial number of the instrument. If a serial number is not available, some unique identifier can be substituted. No two instruments of the same model may have the same serial number.
|-
|-
| url || character varying || YES || [None]
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
|}


<span id="rov.cruise_fn_contact"></span>
<span id="rov.instrument_config"></span>
=== Table: cruise_fn_contact ===
=== Table: instrument_config ===


A table for associating First Nations contacts with a cruise.
This table records the configuration of an instrument, including settings and its spatial relationship to a parent entity -- another configured vehicle or instrument upon which this instrument is mounted.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "cruise_fn_contact"
|+ Columns in "instrument_config"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| contact_name || character varying || NO || The full name of the contact.
| configuration || jsonb || YES || Configuration information about the instrument config.
|-
|-
| cruise_id || integer || NO || A reference to the [[#rov.cruise|cruise]].
| created_on || timestamp without time zone || NO || The date of creation of this record.
|-
|-
| email || character varying || YES || The email address of the contact.
| instrument_id || integer || NO || Reference to the [[#rov.instrument|instrument]] targeted by the configuration.
|-
| mark_for_delete || boolean || NO || Marks the entity for asynchronous deletion by the runner.
|-
|-
| nation || text || YES || The name of the nation or group represented by the contact.
| note || text || YES || An optional note about this configuration.
|-
|-
| note || text || YES || A note about the contact.
| platform_config_id || integer || YES || The ID of the [[#rov.platform|platform]] upon which the instrument is used.
|-
|-
| phone || character varying || YES || The phone number of the contact.
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
|}


<span id="rov.cruise_library"></span>
<span id="rov.measurement"></span>
=== Table: cruise_library ===
=== Table: measurement ===


This table creates an association between a [[#rov.cruise_leg|cruise leg]] and [[#rov.library|documents in the library]] that may be relevant to its research objectives.
This table preserves time-stamped measurements generated by [[#rov.instrument_config|instruments]]. Each measurement has an associated quantity and unit. TODO: At this point multi-part measurement would be stored separately as the ability to store vectors isn't universal across DBMSes.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "cruise_library"
|+ Columns in "measurement"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| cruiseleg_id || integer || NO || A reference to the [[#rov.cruise_leg|cruise leg]].
| instrument_config_id || integer || NO || The [[#rov.instrument_config|configured instrument]] used to generate this item.
|-
| is_modelled || boolean || NO || A flag to indicate whether the value is derived from measurements by some modelling process.
|-
| measurement_type_id || integer || NO || A reference to the [[#rov.measurement_type|type]] of this measurement.
|-
| quantity || real || NO || The scalar quantity or magnitude of the measurement.
|-
|-
| library_id || integer || NO || A reference to the document in the [[#rov.library|library]].
| signal_quality || real || YES || A quality of the measurement as reported by the instrument. TODO: Requires clarification.
|-
|-
| note || text || YES || An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc.
| timestamp || timestamp without time zone || NO || The time that the measurement was recorded.
|}
|}


<span id="rov.cruise_program"></span>
<span id="rov.measurement_type"></span>
=== Table: cruise_program ===
=== Table: measurement_type ===


A table to link [[#rov.program|programs]] and [[#rov.cruise|cruises]]. A cruise can be under the auspices of more than one program or none.
This is a lookup table of types of measurement types for the [[#rov.measurement|measurement]] or [[#rov.measurement_event|measurement_event]] tables. This is fairly open-ended and can represent something like salinity with a specific unit, be it the SI unit or a discipline-specific unit. It is provided to allow users to easily select units for a measurement category when importing data.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "cruise_program"
|+ Columns in "measurement_type"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| cruise_id || integer || NO || The ID of a [[#rov.cruise|cruise]].
| maximum || real || YES || An optional upper bound on the value of the measurement. Null implies no limit.
|-
|-
| program_id || integer || NO || The ID of a [[#rov.program|program]].
| minimum || real || YES || An optional lower bound on the value of the measurement. Null implies no limit.
|}
 
<span id="rov.cruise_role"></span>
=== Table: cruise_role ===
 
A lookup table of roles available to members of [[#rov.cruise_leg_crew|cruise leg crews]].
 
{| class="wikitable"
|+ Columns in "cruise_role"
|-
|-
! Name !! Type !! Nullable !! Documentation
| name || character varying || NO || The type of measurement. E.g., "Density" or "Salinity."
|-
|-
| name || character varying || NO || The name of the role.
| note || text || YES || An optional note about this measurement type.
|-
|-
| note || text || YES || An optional note about the role and its responsibilities.
| short_code || character varying || YES || Contains a short code that can be used to look up a measurement type (e.g., during import) without relying on the primary key.
|-
|-
| short_code || character varying || NO || [None]
| unit || character varying || NO || The unit. SI units are preferred but not required. The unit selection should probably depend on field-specific idiomatic or cultural preferences.
|}
|}


<span id="rov.disturbance"></span>
<span id="rov.medium_format"></span>
=== Table: disturbance ===
=== Table: medium_format ===


Provides a nominal level of disturbance for [[#rov.habitat_event|habitat events]].
A lookup table for data formats for the [[#rov.medium|medium]] table. This will include things like video, photo and acoustic. TODO: To be determined whether medium formats should be discriminated more granularly than this. TODO: Should maybe be categorised into video/photo/acoustic/etc. along with things like the format (JPG, MP4, AAC) and possibly more specific encoding parameters.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "disturbance"
|+ Columns in "medium_format"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The textual representation of the disturbance level.
| extensions || jsonb || NO || A list of file extensions that correspond to this medium type. For example, the JPEG image type may have extensions "jpg" or "jpeg" in any case. This list will help applications guess the correct format of a file if it isn't known. Note that more than one media type can have the same extension, so this feature doesn't provide a guaranteed one-to-one mapping. Use it only as a guide.
|-
|-
| note || text || YES || A note about the disturbance level.
| medium_type_id || integer || NO || A reference to the [[#rov.medium_type|medium type]] (e.g., video or photo).
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a disturbance (e.g., during import) without relying on the primary key.
| name || character varying || NO || The name of the format.
|-
| note || text || YES || An optional note about the format.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a medium format (e.g., during import) without relying on the primary key.
|}
|}


<span id="rov.dive"></span>
<span id="rov.medium_type"></span>
=== Table: dive ===
=== Table: medium_type ===


A dive is what an ROV does. The dive has a start and end time (not necessarily submerge/resurface), a [[#rov.dive_crew|crew]] and possibly a name. [[#rov.transect|Transects]] occur during dives.
A simple lookup to provide media types to the [[#rov.annotation_protocol|annotation_protocol]] table. These are not specific media formats (as stored in [[#rov.medium_format|medium_format]]), but provided a higher-level distinction.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "dive"
|+ Columns in "medium_type"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| attributes || jsonb || YES || A JSON column used for recording structured attributes that do not fit with the regular table structure.
| name || character varying || NO || The name of the media type.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| note || text || YES || An optional note about the media type.
|-
|-
| cruise_id || integer || NO || A reference to the [[#rov.cruise_leg|cruise leg]] during which the dive was performed.
| short_code || character || YES || Provides a short code for looking up the entity.
|}
 
<span id="rov.model"></span>
=== Table: model ===
 
This table records the brand and model of equipment in the inventory. This data is abstract, which is to say, there is only one record for "GoPro Hero4" but there will be one record for each concrete instance of the model in the [[#rov.instrument|instrument]] table. The model table stores both [[#rov.instrument|instruments]] and [[#rov.platform|platforms]].
 
{| class="wikitable"
|+ Columns in "model"
|-
|-
| end_time || timestamp without time zone || NO || The end of the dive.
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || A name for the dive.
| attributes || jsonb || YES || A free-form JSON field for attributes of this model.
|-
|-
| note || text || YES || An optional note about the dive.
| brand_name || character varying || NO || The brand name.
|-
|-
| objective || text || YES || A statement of the practical or research objectives for this dive.
| equipment_type_id || integer || NO || A reference to the [[#rov.equipment_type|equipment type]].
|-
|-
| ship_config_id || integer || NO || A reference to the [[#rov.platform_config|platform config]] for the ship.
| model_name || character varying || NO || The model name.
|-
|-
| site_id || integer || YES || Optional reference to the geographic [[#rov.site|site]] of the dive.
| note || text || YES || An optional note about the model.
|-
| start_time || timestamp without time zone || NO || The start of the dive. Not necessarily the time the vehicle is placed in the water.
|-
| sub_config_id || integer || NO || A reference to the [[#rov.platform_config|platform config]] for the submersible or ROV.
|-
| summary || text || YES || A summary of the [[#rov.dive|dive]]; whether objectives were met, problems encountered, etc.
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
|}


<span id="rov.dive_crew"></span>
<span id="rov.model_documentation"></span>
=== Table: dive_crew ===
=== Table: model_documentation ===


Assigns roles to dive crew members. Crew members are selected from the [[#rov.person|person]].
This table creates an association between a [[#rov.model|model]] and [[#rov.library|documentation in the library]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "dive_crew"
|+ Columns in "model_documentation"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| dive_id || integer || NO || The [[#rov.dive|dive]] to which the crew member is assigned.
| library_id || integer || NO || A reference to the document in the [[#rov.library|library]].
|-
|-
| dive_role_id || integer || NO || A reference to the [[#rov.dive_role|dive role]].
| model_id || integer || NO || A reference to the [[#rov.model|model]].
|-
|-
| note || text || YES || An optional note about the crew member.
| note || text || YES || An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc.
|-
| person_id || integer || NO || A reference to the [[#rov.person|person]].
|}
|}


<span id="rov.dive_role"></span>
<span id="rov.model_equipment_type"></span>
=== Table: dive_role ===
=== Table: model_equipment_type ===


A list of roles available to crew members on a [[#rov.dive|dive]] via the [[#rov.dive_crew|dive_crew]] table.
This table associates an equipment [[#rov.model|model]] with the abstract type of equipment it represents. For example, a GoPro Hero4 is both a digital video camera and a digital still camera. These values are taken from the [[#rov.equipment_type|equipment_type]] table.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "dive_role"
|+ Columns in "model_equipment_type"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the role.
| equipment_type_id || integer || NO || The [[#rov.equipment_type|equipment type]] ID.
|-
|-
| note || text || YES || An optional description of the role.
| model_id || integer || NO || A reference to the [[#rov.model|model]].
|-
| short_code || character varying || NO || [None]
|}
|}


<span id="rov.equipment_type"></span>
<span id="rov.observation_confidence"></span>
=== Table: equipment_type ===
=== Table: observation_confidence ===


This is a lookup table to provide the names of types of equipment for the [[#rov.model_equipment_type|model_equipment_type]] table, e.g., "Digital Still Camera", "Thermometer," "ROV," etc.
Provides a nominal observation confidence level for [[#rov.observation_event|observation events]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "equipment_type"
|+ Columns in "observation_confidence"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| category || USER-DEFINED || YES || An enumeration column identifying the equipment as platform, instrument or some other type.
| name || character varying || NO || The textual representation of the confidence level.
|-
|-
| name || character varying || NO || A name for the equipment type.
| note || text || YES || A note about the confidence level.
|-
|-
| note || text || YES || An optional note about the equipment type.
| rank || integer || NO || This field is a way of ranking confidence levels so that an ordering can be established.
|-
|-
| short_code || character varying || NO || A short code for referencing the equipment type in import documents.
| short_code || character varying || YES || Contains a short code that can be used to look up a observation confidence (e.g., during import) without relying on the primary key.
|}
|}


<span id="rov.event"></span>
<span id="rov.orientation"></span>
=== Table: event ===
=== Table: orientation ===


The event table is a parent or abstract table that provides properties common to [[#rov.habitat_event|habitat]], [[#rov.observation_event|observation]], [[#rov.status_event|status]] and [[#rov.measurement_event|measurement]] events. Each of those event records must have a reference to one event record. Conceptually, the event row and its child entity row are considered to be one object.
This table preserves time-stamped orientation measurements from [[#rov.instrument_config|instruments]]. These are interpreted according to a [[#rov.orientation_type|specified type]]. Ship and ROV orientation will be recorded here, though ships don't ordinarily have an orientation.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "event"
|+ Columns in "orientation"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| attributes || jsonb || YES || [None]
| instrument_config_id || integer || NO || The [[#rov.instrument_config|configured instrument]] used to generate this item.
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of this record.
| is_modelled || boolean || NO || A flag to indicate whether the value is derived from measurements by some modelling process.
|-
|-
| dive_id || integer || NO || A reference to a [[#rov.dive|dive]].
| orientation || jsonb || NO || The orientation vector.
|-
|-
| end_time || timestamp without time zone || YES || The end time of the event. If the event is instantaneous, this field is null.
| orientation_type_id || integer || NO || A reference to the [[#rov.orientation_type|orientation type]] of this orientation.
|-
|-
| frames || jsonb || YES || Preserves the frames from the Biigle annotation.
| signal_quality || real || YES || The signal quality of the position as reported by the instrument. TODO: Requires clarification.
|-
|-
| medium_filename || character varying || YES || The name of the media file from which this event is derived.
| timestamp || timestamp without time zone || NO || The time the position was recorded.
|-
| medium_id || integer || YES || A reference to the [[#rov.medium|medium]] on which this annotation was created.
|-
| original_id || integer || NO || The original ID of the event if read from a source that has IDs.
|-
| original_labels || jsonb || YES || Optionally stores information about annotation labels used to generate this event. For Biigle, stores the label IDs.
|-
| shape || jsonb || YES || The shape used for annotations (e.g., Biigle). The coordinates for this shape should have been converted to metres. GeoJSON doesn't support circles, so we use a format that encapsulates the shape type and the raw list of coordinates, something like: { "type": "circle", "shape": [1.0, 1.0, 1.0] } which is a circle with radius 1 at position 1,1. A whole-screen annotation will be a rectangle the size of the screen.
|-
| shape_area || double precision || YES || The area of the shape in square metres, calculated from the screenand shape dimensions and the laser point distance.
|-
| start_time || timestamp without time zone || NO || The time at the start of the event. If the event is instantaneous, this is the time at which it occurred.
|-
| tags || jsonb || YES || Stores a list of tags relevant to this event.
|-
| transect_id || integer || YES || An optional reference to a [[#rov.transect|transect]]. TODO: Clarify the use of transects and whether this column is nullable.
|}
|}


<span id="rov.event_logger"></span>
<span id="rov.orientation_type"></span>
=== Table: event_logger ===
=== Table: orientation_type ===


This table tracks the [[#shared.person|people]] who contributed to annotation, which may be composed of a number of separate labels.
These entities describe the interpretation of the orientation vector in the [[#rov.instrument_config|instrument_config]] and [[#rov.orientation|orientation]] tables. This can be a 3- or 4-element vector representing yaw, pitch roll; Tait-Bryan angles; Euler angles or a Quaternion.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "event_logger"
|+ Columns in "orientation_type"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| event_id || integer || NO || The [[#rov.event|event]] that was created from the annotation(s).
| name || character varying || NO || The name of the orientation type (e.g., "Quaternion").
|-
| note || text || YES || An optional note about the orientation type.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up an orientation type (e.g., during import) without relying on the primary key.
|-
|-
| person_id || integer || NO || A [[#shared.person|person]] who contributed to the annotation.
| unit || character varying || NO || The units used to interpret the elements of the vector.
|}
|}


<span id="rov.habitat_event"></span>
<span id="rov.platform"></span>
=== Table: habitat_event ===
=== Table: platform ===


The habitat event table records information about the [[#rov.biocover|biocover]], [[#rov.thickness|thickness]], [[#rov.substrate|substrate]] and [[#rov.complexity|complexity]] of the habitat. Some survey protocols record the taxon with biocover observations. A reference to the [[#shared.taxon|taxon]] table is provided. This table is a realization of the [[#rov.event|event]] table.
This table maintains the inventory of vehicles, that is, ships and ROVs.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "habitat_event"
|+ Columns in "platform"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| annotation_protocol_id || integer || NO || A reference to the [[#rov.annotation_protocol|annotation protocol]] used in the creation of this observation.
| attributes || jsonb || YES || A freeform list of attributes for this platform.
|-
|-
| biocover_coverage_id || integer || YES || A [[#rov.coverage|coverage]] value for the [[#rov.biocover|biocover]].
| created_on || timestamp without time zone || NO || The date of creation of this record.
|-
|-
| biocover_id || integer || YES || A reference to the [[#rov.biocover|biocover]] lookup.
| model_id || integer || NO || A reference to the [[#rov.model|model]] of the platform.
|-
|-
| complexity_id || integer || YES || A reference to the [[#rov.complexity|habitat complexity]] lookup.
| name || character varying || NO || The name of the platform. If this is a ship, it might be "CCGS Vector" or if it's an ROV, it might be given an arbitrary name by the maintainer.
|-
|-
| disturbance_id || integer || YES || Indicates the level of disturbance of the substrate and/or biota.
| note || text || YES || An optional note about this platform.
|-
|-
| event_id || integer || NO || A reference to the parent [[#rov.event|event]].
| organisation_id || integer || NO || A reference to the organisation that owns and operates the platform.
|-
|-
| relief_id || integer || YES || A reference to the [[#rov.relief|relief]] level.
| retired || date || YES || If the platform is retired, this records the date. If null, the platform is assumed to be active.
|-
|-
| substrate_coverage_id || integer || YES || A [[#rov.coverage|coverage]] value for the [[#rov.substrate|substrate]].
| serial_number || character varying || YES || The serial number of the platform. If this is an ROV it will be the manufacturer's serial number. If it's a vessel, this might be the IMO number. In any case, it must be unique.
|-
|-
| substrate_id || integer || YES || A reference to the dominant [[#rov.substrate|substrate]] lookup.
| short_code || character || YES || Contains a short code that can be used to look up a platform (e.g., during import) without relying on the primary key.
|-
|-
| taxon_id || integer || YES || A reference to the [[#shared.taxon|taxon]] used in the creation of this observation.
| updated_on || timestamp without time zone || NO || The date of update of this record.
|-
| thickness_id || integer || YES || A reference to the [[#rov.thickness|biocover thickness]] lookup.
|}
|}


<span id="rov.image_quality"></span>
<span id="rov.platform_config"></span>
=== Table: image_quality ===
=== Table: platform_config ===


Nominal image quality levels, originally used by VideoMiner but applicable to new records.
This table stores configuration information about vehicles (ships, ROVs,etc.) used for surveys. All references to vehicles are made through this table rather than directly to the [[#rov.platform|platform]] table, because the disposition of equipment on the platform is essential to understanding how data has been generated, as well as for simple record-keeping purposes.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "image_quality"
|+ Columns in "platform_config"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || A name for the quality level.
| configuration || jsonb || YES || The configuration data as a JSON object.
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
|-
| mark_for_delete || boolean || NO || Marks the entity for asynchronous deletion by the runner.
|-
|-
| note || text || YES || An optional note.
| note || text || YES || An optional note about the configuration record.
|-
|-
| rank || integer || YES || An ordinal rank (zero is high) for the quality level.
| platform_id || integer || NO || A reference to the [[#rov.platform|platform]].
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up an image quality (e.g., during import) without relying on the primary key.
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
|}


<span id="rov.import_queue_annotator"></span>
<span id="rov.position"></span>
=== Table: import_queue_annotator ===
=== Table: position ===


Stores the import packages created by annotators.
This table preserves time-stamped position measurements from [[#rov.instrument_config|instruments]]. These can be linear (e.g., UTM) or angular (e.g., Geographic) positions in a [[#rov.position_type|specified unit]]. Ship and ROV positions will be recorded here. TODO: Should this table have a spatial object (point) as well, or be split into two tables, one for absolute georeferenced positions and one for relative positions and orientations?


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "import_queue_annotator"
|+ Columns in "position"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of the record.
| geom || geometry || YES || The point geometry.
|-
|-
| cruise_name || character varying || NO || The name of the [[#rov.cruise|cruise]] to which this record is linked. A lookup is not used because the cruise record may not have been created yet.
| instrument_config_id || integer || NO || The [[#rov.instrument_config|configured instrument]] used to generate this item.
|-
|-
| data || jsonb || NO || Stores the JSON representation of the import job.
| is_modelled || boolean || NO || A flag to indicate whether the value is derived from measurements by some modelling process.
|-
|-
| mseauser_id || integer || NO || A reference to the [[#shared.mseauser|MSEA user]] that created the record.
| position_type_id || integer || NO || A reference to the [[#rov.position_type|position type]] of this position.
|-
|-
| name || character varying || NO || A unique name for the import queue record.
| signal_quality || real || YES || The signal quality of the position as reported by the instrument. TODO: Requires clarification.
|-
|-
| note || text || YES || An optional note about the import package.
| timestamp || timestamp without time zone || NO || The time the position was recorded.
|-
| status || character varying || YES || A short description of the processing status of the job.
|-
| updated_on || timestamp without time zone || NO || The date of update of the record.
|}
|}


<span id="rov.import_queue_annotator_label_map_prefill"></span>
<span id="rov.position_type"></span>
=== Table: import_queue_annotator_label_map_prefill ===
=== Table: position_type ===


A table to store the last configured tags and values for labels. Provides pre-filling in label mapping application.
Describes the interpretation of a coordinate vector in the [[#rov.position|position]] table. These can be geographic or Cartesian positions or orientations and have defined linear or angular units.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "import_queue_annotator_label_map_prefill"
|+ Columns in "position_type"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| created_on || timestamp without time zone || YES || [None]
| name || character varying || NO || The name of the position type. E.g., "Geographic" or "Yaw, Pitch, Roll."
|-
|-
| label_tree_name || character varying || YES || The label tree name. If given identifies the label uniquely with the tree name.
| note || text || YES || An optional note about this position type.
|-
|-
| name || character varying || NO || The text of the label.
| short_code || character varying || YES || Contains a short code that can be used to look up a position type (e.g., during import) without relying on the primary key.
|-
|-
| tag_data || jsonb || NO || The the tag data.
| unit || character varying || NO || The unit. Linear or angular. E.g., "m" or "radians."
|-
| tags || jsonb || NO || The list of tags.
|-
| updated_on || timestamp without time zone || YES || [None]
|}
|}


<span id="rov.import_queue_pi"></span>
<span id="rov.program"></span>
=== Table: import_queue_pi ===
=== Table: program ===


Stores the import packages created by principal investigators.
This is a listing of scientific programs that can be associated with [[#rov.cruise_leg|cruise legs]], and gives information about the governorship and funding of specific research activities. [[#rov.label_tree|Label trees]] and [[#shared.taxonomy|taxonomies]] may be associated with programs, since some trees are relevant to specific research objectives and not others. TODO: Currently a lable tree/taxonomy can only be linked to one program. Need to study further.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "import_queue_pi"
|+ Columns in "program"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of the record.
| created_on || timestamp without time zone || NO || The date of creation of this item.
|-
| end_date || date || YES || The optional end date of the program.
|-
|-
| cruise_id || integer || NO || A reference to the [[#rov.cruise|cruise]].
| name || character varying || NO || The name of the program.
|-
|-
| mseauser_id || integer || NO || A reference to the [[#shared.mseauser|MSEA user]] that created the record.
| note || text || YES || An optional note about the program.
|-
|-
| name || character varying || NO || A name of the import job
| objective || character varying || YES || The objective or mandate of the program.
|-
|-
| note || text || YES || An optional note about the import package.
| start_date || date || NO || The starting date of the program.
|-
|-
| status || character varying || YES || A short description of the processing status of the job.
| summary || text || YES || A summary of the [[#rov.program|program]]; whether objectives were met, problems encountered, etc.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of the record.
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
|}


<span id="rov.instrument"></span>
<span id="rov.program_library"></span>
=== Table: instrument ===
=== Table: program_library ===


This table represents instruments, which are concrete instances of the types represented in the [[#rov.model|model]] table. instruments tend to be things that generate data, be it a thermometer or a camera. For the purposes of this database, an instrument is anything that is not a [[#rov.platform|platform]].
A table to associate [[#rov.program|programs]] with [[#shared.library|library]] documents.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "instrument"
|+ Columns in "program_library"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| attributes || jsonb || YES || A freeform list of attributes for this instrument.
| library_id || integer || NO || A reference to the [[#shared.library|library]] item.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| program_id || integer || NO || A reference to the [[#rov.program|program]] item.
|-
|}
| model_id || integer || NO || A reference to the instrument [[#rov.model|model]].
 
|-
<span id="rov.program_member"></span>
| note || text || YES || An optional note about this instrument.
=== Table: program_member ===
 
Assigns [[#rov.person|user]] [[#rov.program_role|roles]] to a [[#rov.program|program]].
 
{| class="wikitable"
|+ Columns in "program_member"
|-
|-
| organisation_id || integer || NO || A reference to the organisation that owns and operates the instrument.
! Name !! Type !! Nullable !! Documentation
|-
|-
| retired || date || YES || If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active.
| person_id || integer || NO || A reference to the [[#rov.person|person]].
|-
|-
| serial_number || character varying || NO || The serial number of the instrument. If a serial number is not available, some unique identifier can be substituted. No two instruments of the same model may have the same serial number.
| program_id || integer || NO || The reference to the [[#rov.program|program]].
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up an instrument (e.g., during import) without relying on the primary key.
| role_id || integer || NO || A reference to the [[#rov.program_role|program role]].
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
|}


<span id="rov.instrument_config"></span>
<span id="rov.program_role"></span>
=== Table: instrument_config ===
=== Table: program_role ===


This table records the configuration of an instrument, including settings and its spatial relationship to a parent entity -- another configured vehicle or instrument upon which this instrument is mounted.
Represents the roles a [[#rov.person|person]] might perform in respect to a [[#rov.program|program]]. A person can be assigned multiple roles within a single program, and multiple people can work on a program with the same role.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "instrument_config"
|+ Columns in "program_role"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| configuration || jsonb || YES || Configuration information about the instrument config.
| name || character varying || NO || The name of the role. E.g., "Chief Scientist."
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| note || text || YES || An optional note about the role.
|-
|}
| instrument_id || integer || NO || Reference to the [[#rov.instrument|instrument]] targeted by the configuration.
 
|-
<span id="rov.protocol"></span>
| name || character varying || NO || The name of the instrument config. Need not be unique: used to identify the config within the platform config.
=== Table: protocol ===
|-
| note || text || YES || An optional note about this configuration.
|-
| platform_config_id || integer || YES || [None]
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}


<span id="rov.measurement"></span>
This table stores "(survey) protocol" entries from the source data. TODO: Used by [[#rov.event|events]] though it's not yet clear if it should stay this way.
=== Table: measurement ===
 
This table preserves time-stamped measurements generated by [[#rov.instrument_config|instruments]]. Each measurement has an associated quantity and unit. TODO: At this point multi-part measurement would be stored separately as the ability to store vectors isn't universal across DBMSes.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "measurement"
|+ Columns in "protocol"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| instrument_config_id || integer || NO || The [[#rov.instrument_config|configured instrument]] used to generate this item.
| name || character varying || NO || A name for the survey protocol.
|-
|-
| is_modelled || boolean || NO || A flag to indicate whether the value is derived from measurements by some modelling process.
| note || text || YES || An optional note about the protocol.
|-
| measurement_type_id || integer || NO || A reference to the [[#rov.measurement_type|type]] of this measurement.
|-
|-
| quantity || real || NO || The scalar quantity or magnitude of the measurement.
| short_code || character varying || YES || Contains a short code that can be used to look up a survey protocol (e.g., during import) without relying on the primary key.
|-
| signal_quality || real || YES || A quality of the measurement as reported by the instrument. TODO: Requires clarification.
|-
| timestamp || timestamp without time zone || NO || The time that the measurement was recorded.
|}
|}


<span id="rov.measurement_event"></span>
<span id="rov.relief"></span>
=== Table: measurement_event ===
=== Table: relief ===


A table for storing human-created measurements.
Provides a nominal level of terrain relief for [[#rov.habitat_event|habitat events]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "measurement_event"
|+ Columns in "relief"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| event_id || integer || NO || A reference to the parent [[#rov.event|event]].
| name || character varying || NO || The textual representation of the relief level.
|-
|-
| measurement_type_id || integer || NO || A reference to the [[#rov.measurement_type|measurement type]].
| note || text || YES || A note about the relief level.
|-
|-
| quantity || real || NO || The measurement value in the [[#rov.measurement_type|measurement type]] unit.
| short_code || character varying || YES || Contains a short code that can be used to look up a relief (e.g., during import) without relying on the primary key.
|}
|}


<span id="rov.measurement_type"></span>
<span id="rov.signup_area"></span>
=== Table: measurement_type ===
=== Table: signup_area ===


This is a lookup table of types of measurement types for the [[#rov.measurement|measurement]] or [[#rov.measurement_event|measurement_event]] tables. This is fairly open-ended and can represent something like salinity with a specific unit, be it the SI unit or a discipline-specific unit. It is provided to allow users to easily select units for a measurement category when importing data.
Stores the region within which sign-ups are permitted, generally North America.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "measurement_type"
|+ Columns in "signup_area"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| maximum || real || YES || An optional upper bound on the value of the measurement. Null implies no limit.
| geom || geometry || YES || The geometry of the sign-up region.
|-
|-
| minimum || real || YES || An optional lower bound on the value of the measurement. Null implies no limit.
| name || character varying || NO || The name of the sign-up region.
|}
 
<span id="rov.status_type"></span>
=== Table: status_type ===
 
This is a lookup table for available status types, such as "on bottom" or "off bottom." These are specialized in the [[#rov.status_type_detail|status_type_detail]] table where a note distinguishes different flavours of a given type. For example, there can be multiple types of "Off Transect" events with a different explanation for each.
 
{| class="wikitable"
|+ Columns in "status_type"
|-
|-
| name || character varying || NO || The type of measurement. E.g., "Density" or "Salinity."
! Name !! Type !! Nullable !! Documentation
|-
|-
| note || text || YES || An optional note about this measurement type.
| name || character varying || NO || The name of the status event.
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a measurement type (e.g., during import) without relying on the primary key.
| note || text || YES || An optional description of the status type.
|-
|-
| unit || character varying || NO || The unit. SI units are preferred but not required. The unit selection should probably depend on field-specific idiomatic or cultural preferences.
| short_code || character || YES || A short code for referencing the status type in import documents.
|}
|}


<span id="rov.medium"></span>
<span id="rov.status_type_detail"></span>
=== Table: medium ===
=== Table: status_type_detail ===


This table represents videos, photographs or other media. It may store acoustic data in the future. The table is designed with a hierarchical structure to allow the preservation of links between original data and derived (i.e., cropped or otherwise modified) data. For example, if a ten minute segment of a one hour video is extracted, the new segment can be stored with a reference to its parent.
This table associates a [[#rov.status_type|status type]] with a [[#rov.status_event|status event]]. The point of this indirection is to allow the addition of detail relative to the status type. For example, there are multiple reasons why an ROV might be "off transect", including that the vehicle has experienced a failure, or the pilot is investigating some interesting object with no research value. The [[#rov.status_type|status type]] value is the discriminator for the event, but the detail adds context the doesn't interfere with it.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "medium"
|+ Columns in "status_type_detail"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| biigle_video_id || integer || YES || Provisional: the ID of the video as represented in [https://biigle.de Biigle.de].
| name || character varying || NO || The status type detail. This field distinguishes different uses for [[#rov.status_type|status types]]. For example, there can be more than one reason to record an "Off Transect" event.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| note || text || YES || Optional extended description of detail.
|-
|-
| file_id || integer || NO || A required reference to the [[#shared.file|file]].
| short_code || character || YES || Contains a short code that can be used to look up a status type detail (e.g., during import) without relying on the primary key.
|-
|-
| geostamp_source_id || integer || YES || The source of the geostamp information on photo or video data. Refers to an [[#rov.instrument|instrument]], e.g., a GPS.
| status_type_id || integer || NO || A reference to the [[#rov.status_type|status type]].
|}
 
<span id="rov.substrate"></span>
=== Table: substrate ===
 
A lookup table listing the available substrate types for the [[#rov.habitat_event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
 
{| class="wikitable"
|+ Columns in "substrate"
|-
|-
| height || integer || YES || The height of the video frame in pixels.
! Name !! Type !! Nullable !! Documentation
|-
|-
| instrument_config_id || integer || NO || An [[#rov.instrument_config|instrument configuration]] for the instrument that generated this media.
| name || character varying || NO || The name of the substrate.
|-
|-
| length || real || YES || If a video or acoustic file (etc.), the length in seconds.
| note || text || YES || An optional description of the substrate.
|-
|-
| medium_format_id || integer || YES || A reference to the [[#rov.medium_format|format]] of the data.
| short_code || character varying || YES || Contains a short code that can be used to look up a substrate (e.g., during import) without relying on the primary key.
|-
| note || text || YES || An optional note about this data.
|-
| parent_id || integer || YES || If the video or photo is derived or cropped from another, this refers to the source record (optional).
|-
| source_time || real || YES || If this is an extract from a video or a frame grab, indicates the zero-based start time with respect to the source video.
|-
| start_time || timestamp without time zone || NO || The start date/time of this video, or the instantaneous time if it's a photograph.
|-
| thumbnail || bytea || YES || An optional thumbnail to represent the stored medium.
|-
| width || integer || YES || The width of the video frame in pixels.
|}
|}


<span id="rov.medium_format"></span>
<span id="rov.survey_mode"></span>
=== Table: medium_format ===
=== Table: survey_mode ===


A lookup table for data formats for the [[#rov.medium|medium]] table. This will include things like video, photo and acoustic. TODO: To be determined whether medium formats should be discriminated more granularly than this. TODO: Should maybe be categorised into video/photo/acoustic/etc. along with things like the format (JPG, MP4, AAC) and possibly more specific encoding parameters.
This table stores "survey mode" entries from the source data. TODO: Used by [[#rov.event|events]] though it's not yet clear if it should stay this way.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "medium_format"
|+ Columns in "survey_mode"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| extensions || jsonb || NO || A list of file extensions that correspond to this medium type. For example, the JPEG image type may have extensions "jpg" or "jpeg" in any case. This list will help applications guess the correct format of a file if it isn't known. Note that more than one media type can have the same extension, so this feature doesn't provide a guaranteed one-to-one mapping. Use it only as a guide.
| name || character varying || NO || The name of the survey mode.
|-
|-
| medium_type_id || integer || NO || A reference to the [[#rov.medium_type|medium type]] (e.g., video or photo).
| note || text || YES || An optional note about the survey mode.
|-
|-
| name || character varying || NO || The name of the format.
| short_code || character varying || YES || Contains a short code that can be used to look up a survey mode (e.g., during import) without relying on the primary key.
|-
| note || text || YES || An optional note about the format.
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a medium format (e.g., during import) without relying on the primary key.
|}
|}


<span id="rov.medium_type"></span>
<span id="rov.thickness"></span>
=== Table: medium_type ===
=== Table: thickness ===


A simple lookup to provide media types to the [[#rov.annotation_protocol|annotation_protocol]] table. These are not specific media formats (as stored in [[#rov.medium_format|medium_format]]), but provided a higher-level distinction.
A lookup table listing the available substrate thicknesses for the [[#rov.habitat_event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "medium_type"
|+ Columns in "thickness"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the media type.
| maximum || real || YES || The maximum value in the range.
|-
|-
| note || text || YES || An optional note about the media type.
| minimum || real || YES || The minimum value in the range.
|-
| name || character varying || NO || A characterization of biocover thickness.
|-
| note || text || YES || An optional note about the biocover thickness.
|-
|-
| short_code || character || NO || Provides a short code for looking up the entity.
| short_code || character varying || YES || Contains a short code that can be used to look up a thickness (e.g., during import) without relying on the primary key.
|}
|}


<span id="rov.model"></span>
<span id="rov.transect"></span>
=== Table: model ===
=== Table: transect ===


This table records the brand and model of equipment in the inventory. This data is abstract, which is to say, there is only one record for "GoPro Hero4" but there will be one record for each concrete instance of the model in the [[#rov.instrument|instrument]] table. The model table stores both [[#rov.instrument|instruments]] and [[#rov.platform|platforms]].
A transect is a section of a [[#rov.dive|dive]] during which interesting data are collected. Every transect is associated with a [[#rov.dive|dive]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "model"
|+ Columns in "transect"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| attributes || jsonb || YES || A free-form JSON field for attributes of this model.
| admin_note || text || YES || [None]
|-
| attributes || jsonb || YES || A JSON column used for recording structured attributes that do not fit with the regular table structure.
|-
| dive_id || integer || NO || A reference to the [[#rov.dive|dive]] during which this transect occurred.
|-
| end_time || timestamp without time zone || YES || The end time of the transect.
|-
| name || character varying || NO || The name of the transect.
|-
|-
| brand_name || character varying || NO || The brand name.
| note || text || YES || An optional note about the transect.
|-
|-
| equipment_type_id || integer || NO || A reference to the [[#rov.equipment_type|equipment type]].
| objective || text || YES || A statement of the practical or research objectives for this true.
|-
|-
| model_name || character varying || NO || The model name.
| start_time || timestamp without time zone || NO || The start time of the transect.
|-
|-
| note || text || YES || An optional note about the model.
| summary || text || YES || A summary of the [[#rov.transect|transect]]; whether objectives were met, problems encountered, etc.
|}
|}


<span id="rov.model_documentation"></span>
<span id="rov.weather_observation"></span>
=== Table: model_documentation ===
=== Table: weather_observation ===


This table creates an association between a [[#rov.model|model]] and [[#rov.library|documentation in the library]].
Surface weather observations can be recorded by any [[#rov.cruise_leg_crew|crew member]] aboard a ship during a [[#rov.cruise_leg|cruise leg]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "model_documentation"
|+ Columns in "weather_observation"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| library_id || integer || NO || A reference to the document in the [[#rov.library|library]].
| cruise_crew_id || integer || YES || A reference to the [[#rov.cruise_leg_crew|cruise leg crew]] member who is making the report.
|-
| cruise_id || integer || NO || A link to the [[#rov.cruise|cruise]] during which this record was recorded.
|-
| note || text || YES || An optional note about the observation
|-
| pressure || real || YES || The air pressure.
|-
|-
| model_id || integer || NO || A reference to the [[#rov.model|model]].
| swell || character varying || YES || Description of swell.
|-
|-
| note || text || YES || An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc.
| temperature || real || YES || The air temperature.
|}
 
<span id="rov.model_equipment_type"></span>
=== Table: model_equipment_type ===
 
This table associates an equipment [[#rov.model|model]] with the abstract type of equipment it represents. For example, a GoPro Hero4 is both a digital video camera and a digital still camera. These values are taken from the [[#rov.equipment_type|equipment_type]] table.
 
{| class="wikitable"
|+ Columns in "model_equipment_type"
|-
|-
! Name !! Type !! Nullable !! Documentation
| time || timestamp without time zone || NO || An optional note about the weather.
|-
|-
| equipment_type_id || integer || NO || The [[#rov.equipment_type|equipment type]] ID.
| wind_direction || real || YES || The wind direction.
|-
|-
| model_id || integer || NO || A reference to the [[#rov.model|model]].
| wind_speed || real || YES || The wind speed.
|}
|}


<span id="rov.observation_category"></span>
<span id="shared"></span>
=== Table: observation_category ===
== Schema: shared ==


Observation categories are used by [[#rov.annotation_protocol|annotation protocols]].
Stores data that are shared between other schemas, such as personnel information, taxonomy, etc.


{| class="wikitable"  
<span id="shared.db_version"></span>
|+ Columns in "observation_category"
=== Table: db_version ===
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the observation category.
|-
| note || text || YES || An optional note about the observation category.
|-
| short_code || character varying || NO || A short code for referencing the observation category in import documents.
|}


<span id="rov.observation_confidence"></span>
Stores the current database version so that upgrade scripts can perform migrations appropriately.
=== Table: observation_confidence ===
 
Provides a nominal observation confidence level for [[#rov.observation_event|observation events]].


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "observation_confidence"
|+ Columns in "db_version"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The textual representation of the confidence level.
| revision || integer || NO || The revision number.
|-
|-
| note || text || YES || A note about the confidence level.
| updated_on || timestamp without time zone || NO || The time the upgrade was performed.
|-
|-
| rank || integer || NO || This field is a way of ranking confidence levels so that an ordering can be established.
| version_major || integer || NO || The major version.
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a observation confidence (e.g., during import) without relying on the primary key.
| version_minor || integer || NO || The minor version number.
|}
|}


<span id="rov.observation_event"></span>
<span id="shared.file"></span>
=== Table: observation_event ===
=== Table: file ===


An observation event records the occurrence of a phenomenon as a result of observation by a human user, usually by analyzing a video recording or photograph. Observations can relate to a species taxonomy or an element in a [[#rov.label_tree|label tree]]. This table will be "sparse," that is, certain a value will be given for only one or two columns in each row, and the interpretation of the values will be informed by the information in the [[#rov.annotation_protocol|annotation protocol]] table. This table is a realization of the [[#rov.event|event]] table.
Stores a record of a file object and its location on disk, along with some metadata. This entity is used by all other entities in all schemas that refer to a file object. This should make it easier to audit file stores and e.g., find duplicates using the hash.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "observation_event"
|+ Columns in "file"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| abundance_id || integer || YES || Link to an [[#rov.abundance|abundance level]].
| blob_url || character varying || YES || A URL referencing the file in online blob storage. This field is subject to change depending on where the files reside and will change if they're moved.
|-
|-
| annotation_protocol_id || integer || NO || A reference to the [[#rov.annotation_protocol|annotation protocol]] used in the creation of this observation.
| created_on || timestamp without time zone || NO || The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
|-
|-
| category || character varying || YES || A free-form category label used for distinguishing types of labels within an annotation project. Useful for flagging records for review.
| description || text || YES || An optional description for the file.
|-
|-
| count || integer || YES || The number of individuals observed. TODO: Interpretation depends on the observation interval as recorded in the[[#rov.annotation_protocol|annotation protocol]] table.
| file_type_id || integer || YES || An optional reference to the [[#shared.file_type|file type]].
|-
|-
| coverage_id || integer || YES || Provides an indication of the amount of a scene [[#rov.coverage|covered]] by an organism. Implies habitat forming.
| hash || character varying || NO || And MD5 hash of the file data. Used to compare files and search for identical versions.
|-
|-
| event_id || integer || NO || A reference to the parent [[#rov.event|event]].
| metadata || jsonb || YES || A JSON dictionary containing metadata relating to the file.
|-
|-
| observation_confidence_id || integer || YES || References the [[#rov.observation_confidence|observation confidence]] lookup to indicate the user's confidence in the observation.
| name || character varying || NO || The name for the file.
|-
|-
| taxon_id || integer || YES || A reference to the [[#shared.taxon|taxon]] used in the creation of this observation.
| path || character varying || NO || A path of the file, relative to the root directory where files are stored.
|-
| updated_on || timestamp without time zone || NO || The update time of the file record, not necessarily the file itself (this should be stored in metadata).
|}
|}


<span id="rov.orientation"></span>
<span id="shared.file_type"></span>
=== Table: orientation ===
=== Table: file_type ===


This table preserves time-stamped orientation measurements from [[#rov.instrument_config|instruments]]. These are interpreted according to a [[#rov.orientation_type|specified type]]. Ship and ROV orientation will be recorded here, though ships don't ordinarily have an orientation.
A list of file types.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "orientation"
|+ Columns in "file_type"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| instrument_config_id || integer || NO || The [[#rov.instrument_config|configured instrument]] used to generate this item.
| name || character varying || NO || The name of the file type.
|-
|-
| is_modelled || boolean || NO || A flag to indicate whether the value is derived from measurements by some modelling process.
| short_code || character varying || NO || A short code for referencing the file type in import documents.
|-
| orientation || jsonb || NO || The orientation vector.
|-
| orientation_type_id || integer || NO || A reference to the [[#rov.orientation_type|orientation type]] of this orientation.
|-
| signal_quality || real || YES || The signal quality of the position as reported by the instrument. TODO: Requires clarification.
|-
| timestamp || timestamp without time zone || NO || The time the position was recorded.
|}
|}


<span id="rov.orientation_type"></span>
<span id="shared.library"></span>
=== Table: orientation_type ===
=== Table: library ===


These entities describe the interpretation of the orientation vector in the [[#rov.instrument_config|instrument_config]] and [[#rov.orientation|orientation]] tables. This can be a 3- or 4-element vector representing yaw, pitch roll; Tait-Bryan angles; Euler angles or a Quaternion.
This table stores a partial record of documents, books and papers that can be referenced by other entities. The ISBN and DOI fields are set to unique, but these may vary (in representation, at least) for a single document so care should be taken not to add duplicates. However, updated papers with the same title and author, but different date, are not disallowed.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "orientation_type"
|+ Columns in "library"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the orientation type (e.g., "Quaternion").
| abstract || text || YES || The abstract of the entry.
|-
|-
| note || text || YES || An optional note about the orientation type.
| authors || jsonb || YES || The (list of) author(s) of the document. This is a JSON list of objects containing whatever information is necessary. Authors should be listed with at least first_name and last_name, and any other relevant information, such as email or institution.
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up an orientation type (e.g., during import) without relying on the primary key.
| created_on || timestamp without time zone || YES || The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
|-
|-
| unit || character varying || NO || The units used to interpret the elements of the vector.
| doi || character varying || YES || The DOI of the document.
|}
 
<span id="rov.platform"></span>
=== Table: platform ===
 
This table maintains the inventory of vehicles, that is, ships and ROVs.
 
{| class="wikitable"
|+ Columns in "platform"
|-
|-
! Name !! Type !! Nullable !! Documentation
| file_id || integer || NO || An optional reference to a [[#shared.file|file]].
|-
|-
| attributes || jsonb || YES || A freeform list of attributes for this platform.
| institution || character varying || YES || The name of the institution or publisher responsible for the document.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| isbn || character varying || YES || The ISBN of the book, if it is a book.
|-
|-
| model_id || integer || NO || A reference to the [[#rov.model|model]] of the platform.
| issn || character varying || YES || The ISSN of the entry.
|-
|-
| name || character varying || NO || The name of the platform. If this is a ship, it might be "CCGS Vector" or if it's an ROV, it might be given an arbitrary name by the maintainer.
| keywords || jsonb || YES || A list of keywords relating to the entry.
|-
|-
| note || text || YES || An optional note about this platform.
| mendeley_id || character varying || YES || The ID of the record in Mendeley.
|-
|-
| organisation_id || integer || NO || A reference to the organisation that owns and operates the platform.
| publication || character varying || YES || The name of the publication in which the document appeared.
|-
|-
| retired || date || YES || If the platform is retired, this records the date. If null, the platform is assumed to be active.
| title || text || NO || The title of the book, paper, or other document.
|-
|-
| serial_number || character varying || YES || The serial number of the platform. If this is an ROV it will be the manufacturer's serial number. If it's a vessel, this might be the IMO number. In any case, it must be unique.
| type || character varying || YES || Describes the type of entry: book, article, etc.
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a platform (e.g., during import) without relying on the primary key.
| updated_on || timestamp without time zone || YES || The update time of the file record, not necessarily the file itself (this should be stored in metadata).
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
| year || character varying || YES || The publishing date of the document.
|}
|}


<span id="rov.platform_config"></span>
<span id="shared.mseauser"></span>
=== Table: platform_config ===
=== Table: mseauser ===


This table stores configuration information about vehicles (ships, ROVs,etc.) used for surveys. All references to vehicles are made through this table rather than directly to the [[#rov.platform|platform]] table, because the disposition of equipment on the platform is essential to understanding how data has been generated, as well as for simple record-keeping purposes.
Represents an MSEA user and is linked to a single Django auth User. Stores extra application-related properties such as the Biigle API key.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "platform_config"
|+ Columns in "mseauser"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| configuration || jsonb || YES || The configuration data as a JSON object.
| allowed || boolean || NO || If true, the user is allowed to sign in. This can be set to false during sign up (e.g., by failing the IP check) or by an admin.
|-
| biigle_api_key || character varying || YES || The Biigle API key.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| biigle_username || character varying || YES || The Biigle username.
|-
|-
| note || text || YES || An optional note about the configuration record.
| bio || text || YES || Biographical information about the user.
|-
|-
| platform_id || integer || NO || A reference to the [[#rov.platform|platform]].
| ip_in_region || boolean || YES || Set to true if the user's IP is within the signup region. False positives and negatives are possible.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
| org_type || character varying || YES || The the type of organization with which the user is affiliated.
|}
 
<span id="rov.position"></span>
=== Table: position ===
 
This table preserves time-stamped position measurements from [[#rov.instrument_config|instruments]]. These can be linear (e.g., UTM) or angular (e.g., Geographic) positions in a [[#rov.position_type|specified unit]]. Ship and ROV positions will be recorded here. TODO: Should this table have a spatial object (point) as well, or be split into two tables, one for absolute georeferenced positions and one for relative positions and orientations?
 
{| class="wikitable"
|+ Columns in "position"
|-
|-
! Name !! Type !! Nullable !! Documentation
| organization || character varying || YES || The organization with which a user is affiliated.
|-
|-
| geom || geometry || YES || The point geometry.
| pg_role || character varying || YES || The name of the PostgreSQL role that the user will use to log in directly to the database.
|-
|-
| instrument_config_id || integer || NO || The [[#rov.instrument_config|configured instrument]] used to generate this item.
| registration_ip || inet || YES || The IP used by the user to register.
|-
|-
| is_modelled || boolean || NO || A flag to indicate whether the value is derived from measurements by some modelling process.
| registration_note || text || YES || Administrator notes about the user's registration status.
|-
|-
| position_type_id || integer || NO || A reference to the [[#rov.position_type|position type]] of this position.
| registration_reason || text || YES || A short note about why the user registered.
|-
|-
| signal_quality || real || YES || The signal quality of the position as reported by the instrument. TODO: Requires clarification.
| user_id || integer || NO || A reference to the [[#public.auth_user|Django user]].
|-
|-
| timestamp || timestamp without time zone || NO || The time the position was recorded.
| verification_code || character || YES || An auto-generated string used to identify the user for verification purposes.
|-
| verification_expiry || timestamp without time zone || YES || The time of expiration of the verification code.
|-
| verification_time || timestamp without time zone || YES || The date and time at which the user was verified.
|}
|}


<span id="rov.position_type"></span>
<span id="shared.organisation"></span>
=== Table: position_type ===
=== Table: organisation ===


Describes the interpretation of a coordinate vector in the [[#rov.position|position]] table. These can be geographic or Cartesian positions or orientations and have defined linear or angular units.
Convenient storage for organisations involved in MSEA activities.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "position_type"
|+ Columns in "organisation"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the position type. E.g., "Geographic" or "Yaw, Pitch, Roll."
| country || character varying || NO || The code for the country where the organisation is based (e.g., "CA" for Canada).
|-
|-
| note || text || YES || An optional note about this position type.
| name || character varying || NO || The full name of the organisation.
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a position type (e.g., during import) without relying on the primary key.
| note || text || YES || An optional note about the organisation.
|-
| unit || character varying || NO || The unit. Linear or angular. E.g., "m" or "radians."
|}
|}


<span id="rov.program"></span>
<span id="shared.person"></span>
=== Table: program ===
=== Table: person ===


This is a listing of scientific programs that can be associated with [[#rov.cruise_leg|cruise legs]], and gives information about the governorship and funding of specific research activities. [[#rov.label_tree|Label trees]] and [[#shared.taxonomy|taxonomies]] may be associated with programs, since some trees are relevant to specific research objectives and not others. TODO: Currently a lable tree/taxonomy can only be linked to one program. Need to study further.
Stores information about people involved in all aspects of the application. This is not intended to be a comprehensive duplicate of the individual's HR dossier, just a means of representing a person and providing a means of associating it with a real-world individual, e.g., by their email.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "program"
|+ Columns in "person"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this item.
| affiliation || character varying || YES || The organization with which this user is currently affiliated.
|-
|-
| end_date || date || YES || The optional end date of the program.
| biigle_user_id || integer || YES || The Biigle database ID of a user. The UUID should be used instead.
|-
|-
| name || character varying || NO || The name of the program.
| biigle_uuid || character || YES || The Biigle UUID is used to identify the user in Biigle apps.
|-
|-
| note || text || YES || An optional note about the program.
| bio || text || YES || A brief biography of the person.
|-
|-
| objective || character varying || YES || The objective or mandate of the program.
| email || USER-DEFINED || YES || Email address.
|-
|-
| start_date || date || NO || The starting date of the program.
| first_name || character varying || NO || First name.
|-
|-
| summary || text || YES || A summary of the [[#rov.program|program]]; whether objectives were met, problems encountered, etc.
| last_name || character varying || NO || Last name.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
| photo || bytea || YES || A photo of the person.
|}
|}


<span id="rov.program_library"></span>
<span id="shared.restriction"></span>
=== Table: program_library ===
=== Table: restriction ===


A table to associate [[#rov.program|programs]] with [[#shared.library|library]] documents.
The restriction table provides restrictions for [[#rov.event|events]], based on specific property keys and values. If any event has a key and matching value in a restriction, the event is not shown to non-administrators.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "program_library"
|+ Columns in "restriction"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| library_id || integer || NO || A reference to the [[#shared.library|library]] item.
| created_on || timestamp without time zone || NO || The date of creation of the restriction.
|-
| key || character varying || NO || The top-level property name or key.
|-
| name || character varying || NO || The name of the restriction.
|-
| note || text || YES || An optional note about the restriction.
|-
| pattern || text || NO || A pattern matching the property value using the SQL ILIKE operator. An exact (case-insensitive) match is a bare string, while appending % at any location is a wildcard match. For example, '%term' matches 'exterm' but not 'exterminate'.
|-
|-
| program_id || integer || NO || A reference to the [[#rov.program|program]] item.
| updated_on || timestamp without time zone || NO || The date of last update of the restriction.
|}
|}


<span id="rov.program_member"></span>
<span id="shared.restriction_group"></span>
=== Table: program_member ===
=== Table: restriction_group ===


Assigns [[#rov.person|user]] [[#rov.program_role|roles]] to a [[#rov.program|program]].
Links the restriction to a group. Members of linked groups are able to view the restricted items.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "program_member"
|+ Columns in "restriction_group"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| person_id || integer || NO || A reference to the [[#rov.person|person]].
| group_id || integer || NO || The ID of the Django authentication group.
|-
|-
| program_id || integer || NO || The reference to the [[#rov.program|program]].
| restriction_id || integer || NO || The ID of the [[#rov.restriction|restriction]].
|-
| role_id || integer || NO || A reference to the [[#rov.program_role|program role]].
|}
|}


<span id="rov.program_role"></span>
<span id="shared.site"></span>
=== Table: program_role ===
=== Table: site ===


Represents the roles a [[#rov.person|person]] might perform in respect to a [[#rov.program|program]]. A person can be assigned multiple roles within a single program, and multiple people can work on a program with the same role.
Contains the names and geographic boundaries of study sites. This will be useful not only for mapping but for querying data by spatial extent.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "program_role"
|+ Columns in "site"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the role. E.g., "Chief Scientist."
| name || character varying || NO || A name for the site.
|-
| note || text || YES || An optional note about the site.
|-
|-
| note || text || YES || An optional note about the role.
| spatial_library_id || integer || YES || A reference to the [[#shared.spatial_library|spatial library]] entry.
|}
|}


<span id="rov.protocol"></span>
<span id="shared.spatial_library"></span>
=== Table: protocol ===
=== Table: spatial_library ===


This table stores "(survey) protocol" entries from the source data. TODO: Used by [[#rov.event|events]] though it's not yet clear if it should stay this way.
Maintains a library of spatial data.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "protocol"
|+ Columns in "spatial_library"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || A name for the survey protocol.
| created_on || timestamp without time zone || NO || The time when this record was created.
|-
|-
| note || text || YES || An optional note about the protocol.
| file_id || integer || YES || A reference to a related [[#shared.file|file]].
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a survey protocol (e.g., during import) without relying on the primary key.
| geom || geometry || YES || A vector representation of the object(s), projected into WGS84 (lat/lon) and stored as a geography type.
|}
 
<span id="rov.relief"></span>
=== Table: relief ===
 
Provides a nominal level of terrain relief for [[#rov.habitat_event|habitat events]].
 
{| class="wikitable"
|+ Columns in "relief"
|-
|-
! Name !! Type !! Nullable !! Documentation
| metadata || jsonb || YES || A JSON object containing metadata related to the spatial object.
|-
|-
| name || character varying || NO || The textual representation of the relief level.
| name || character varying || NO || A name for the entry.
|-
|-
| note || text || YES || A note about the relief level.
| note || text || YES || A note about this library item.
|-
| rast || bytea || YES || A raster.
|-
| thumbnail || bytea || YES || A small thumbnail in binary (JPG) form.
|-
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a relief (e.g., during import) without relying on the primary key.
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
|}


<span id="rov.status_event"></span>
<span id="shared.spatial_library_file"></span>
=== Table: status_event ===
=== Table: spatial_library_file ===


This table records status events with names given by the [[#rov.status_type_detail|status_type_detail]] table. Status events represent a state that changes at some time and persists until another state preempts it. For example, "on bottom" would persist until an "off bottom" event is recorded. A status_event is a specialization of an [[#rov.event|event]].
Allows a [[#shared.spatial_library|spatial library]] entity to own more than one file.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "status_event"
|+ Columns in "spatial_library_file"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| event_id || integer || NO || The associated [[#rov.event|event]].
| file_id || integer || NO || A link to the [[#shared.file|file]].
|-
|-
| status_type_detail_id || integer || NO || The [[#rov.status_type_detail|detailed status type]].
| spatial_library_id || integer || NO || A link to the [[#shared.spatial_library|spatial library]].
|}
|}


<span id="rov.status_type"></span>
<span id="shared.uploaded_file"></span>
=== Table: status_type ===
=== Table: uploaded_file ===


This is a lookup table for available status types, such as "on bottom" or "off bottom." These are specialized in the [[#rov.status_type_detail|status_type_detail]] table where a note distinguishes different flavours of a given type. For example, there can be multiple types of "Off Transect" events with a different explanation for each.
A table to store uploaded files that can be associated with other entities in separate requests. This table is intended to store temporary entities: when an uploaded file has been handled, these records should be deleted.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "status_type"
|+ Columns in "uploaded_file"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || The name of the status event.
| created_on || timestamp without time zone || NO || The time of creation of the record.
|-
| expires_on || timestamp without time zone || NO || The expiry time of the file. It may be deleted by a maintenance script after this time.
|-
| marked_for_delete || boolean || NO || If true, the file is marked for delete. Otherwise it will not be touched unless there is an age limit set in the daemon.
|-
| name || character varying || NO || The original name of the file.
|-
|-
| note || text || YES || An optional description of the status type.
| path || character varying || NO || The path to the temporary location of the file.
|-
|-
| short_code || character varying || NO || A short code for referencing the status type in import documents.
| type || character varying || NO || The guessed MIME type of the file.
|}
|}


<span id="rov.status_type_detail"></span>
<span id="taxonomy"></span>
=== Table: status_type_detail ===
== Schema: taxonomy ==


This table associates a [[#rov.status_type|status type]] with a [[#rov.status_event|status event]]. The point of this indirection is to allow the addition of detail relative to the status type. For example, there are multiple reasons why an ROV might be "off transect", including that the vehicle has experienced a failure, or the pilot is investigating some interesting object with no research value. The [[#rov.status_type|status type]] value is the discriminator for the event, but the detail adds context the doesn't interfere with it.
<span id="taxonomy.taxon"></span>
 
=== Table: taxon ===
{| class="wikitable"
|+ Columns in "status_type_detail"
|-
! Name !! Type !! Nullable !! Documentation
|-
| detail || character varying || NO || The status type detail. This field distinguishes different uses for [[#rov.status_type|status types]]. For example, there can be more than one reason to record an "Off Transect" event.
|-
| note || text || YES || Optional extended description of detail.
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a status type detail (e.g., during import) without relying on the primary key.
|-
| status_type_id || integer || NO || A reference to the [[#rov.status_type|status type]].
|}
 
<span id="rov.substrate"></span>
=== Table: substrate ===
 
A lookup table listing the available substrate types for the [[#rov.habitat_event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.


{| class="wikitable"
Stores taxonomic names from a variety of databases in a common format distinguished by source and taxon_id.
|+ Columns in "substrate"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the substrate.
|-
| note || text || YES || An optional description of the substrate.
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a substrate (e.g., during import) without relying on the primary key.
|}
 
<span id="rov.survey_mode"></span>
=== Table: survey_mode ===
 
This table stores "survey mode" entries from the source data. TODO: Used by [[#rov.event|events]] though it's not yet clear if it should stay this way.


{| class="wikitable"  
{| class="wikitable"  
|+ Columns in "survey_mode"
|+ Columns in "taxon"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the survey mode.
|-
| note || text || YES || An optional note about the survey mode.
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a survey mode (e.g., during import) without relying on the primary key.
|}
 
<span id="rov.thickness"></span>
=== Table: thickness ===
 
A lookup table listing the available substrate thicknesses for the [[#rov.habitat_event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
 
{| class="wikitable"
|+ Columns in "thickness"
|-
! Name !! Type !! Nullable !! Documentation
|-
| maximum || real || YES || The maximum value in the range.
|-
| minimum || real || YES || The minimum value in the range.
|-
| name || character varying || NO || A characterization of biocover thickness.
|-
| note || text || YES || An optional note about the biocover thickness.
|-
| short_code || character varying || NO || Contains a short code that can be used to look up a thickness (e.g., during import) without relying on the primary key.
|}
 
<span id="rov.transect"></span>
=== Table: transect ===
 
A transect is a section of a [[#rov.dive|dive]] during which interesting data are collected. Every transect is associated with a [[#rov.dive|dive]].
 
{| class="wikitable"
|+ Columns in "transect"
|-
! Name !! Type !! Nullable !! Documentation
|-
| attributes || jsonb || YES || A JSON column used for recording structured attributes that do not fit with the regular table structure.
|-
| dive_id || integer || NO || A reference to the [[#rov.dive|dive]] during which this transect occurred.
|-
| end_time || timestamp without time zone || YES || The end time of the transect.
|-
| name || character varying || NO || The name of the transect.
|-
| note || text || YES || An optional note about the transect.
|-
| objective || text || YES || A statement of the practical or research objectives for this true.
|-
| start_time || timestamp without time zone || NO || The start time of the transect.
|-
| summary || text || YES || A summary of the [[#rov.transect|transect]]; whether objectives were met, problems encountered, etc.
|}
 
<span id="rov.weather_observation"></span>
=== Table: weather_observation ===
 
Surface weather observations can be recorded by any [[#rov.cruise_leg_crew|crew member]] aboard a ship during a [[#rov.cruise_leg|cruise leg]].
 
{| class="wikitable"
|+ Columns in "weather_observation"
|-
! Name !! Type !! Nullable !! Documentation
|-
| cruise_crew_id || integer || YES || A reference to the [[#rov.cruise_leg_crew|cruise leg crew]] member who is making the report.
|-
| cruise_id || integer || NO || A link to the [[#rov.cruise|cruise]] during which this record was recorded.
|-
| note || text || YES || An optional note about the observation
|-
| pressure || real || YES || The air pressure.
|-
| swell || character varying || YES || Description of swell.
|-
| temperature || real || YES || The air temperature.
|-
| time || timestamp without time zone || NO || An optional note about the weather.
|-
| wind_direction || real || YES || The wind direction.
|-
| wind_speed || real || YES || The wind speed.
|}
 
<span id="rov.cruise_track"></span>
=== Materialized View: cruise_track ===
 
Constructs a geometry for each [[#rov.cruise|cruise]] which describes the path of the ship.
 
{| class="wikitable"
|+ Columns in "cruise_track"
|-
! Name !! Type !! Nullable !! Documentation
|-
| colour || text || False || The a colour code generated from the cruise's ID used for cartography.
|-
| cruise_id || integer || False || The reference to the [[#rov.cruise|cruise]].
|-
| cruise_name || text || False || The [[#rov.cruise|cruise]] name and leg.
|-
| geom || geometry || False || The cruise track geometry.
|-
| instrument_config_id || integer || False || The reference to the [[#rov.instrument_config|instrument configuration]].
|}
 
<span id="rov.depth"></span>
=== Materialized View: depth ===
 
A view on the [[#rov.measurements|measurements]] table containing only depths.
 
{| class="wikitable"
|+ Columns in "depth"
|-
! Name !! Type !! Nullable !! Documentation
|-
| dive_id || integer || False || The ID of the [[#rov.dive|dive]] during which the depth was measured.
|-
| quantity || real || False || [None]
|-
| timestamp || timestamp(6) without time zone || False || The timestamp of the record.
|}
 
<span id="rov.dive_track"></span>
=== Materialized View: dive_track ===
 
Constructs a geometry for each [[#rov.dive|dive]] which describes the path of the submersible.
 
{| class="wikitable"
|+ Columns in "dive_track"
|-
! Name !! Type !! Nullable !! Documentation
|-
| colour || text || False || The a colour code generated from the cruise's ID. Used for cartography.
|-
| cruise_id || integer || False || The reference to the [[#rov.cruise|cruise]].
|-
| cruise_name || text || False || The [[#rov.cruise|cruise]] name.
|-
| dive_id || integer || False || The reference to the [[#rov.dive|dive]].
|-
| dive_name || character varying(64) || False || The [[#rov.dive|dive]] name.
|-
| geom || geometry || False || The dive track geometry.
|-
| transect_id || integer || False || The reference to the [[#rov.transect|transect]]. Zero if there is no corresponding transect.
|-
| transect_name || character varying(64) || False || The [[#rov.transect|transect]] name.
|}
 
<span id="rov.evt_depth"></span>
=== Materialized View: evt_depth ===
 
Creates a relation between an [[#rov.event|event]] and the [[#rov.measurement|depth]] nearest the start and end times of the event.
 
{| class="wikitable"
|+ Columns in "evt_depth"
|-
! Name !! Type !! Nullable !! Documentation
|-
| end_diff || interval || False || [None]
|-
| end_measurement_id || integer || False || The link to the [[#rov.measurement|depth]] nearest the event's end time, or null if one is not supplied.
|-
| event_id || integer || False || The link to the [[#rov.event|event's]]'s event ID.
|-
| start_diff || interval || False || [None]
|-
| start_measurement_id || integer || False || The link to the [[#rov.measurement|depth]] nearest the event's start time.
|}
 
<span id="rov.evt_pos"></span>
=== Materialized View: evt_pos ===
 
Creates a relation between an [[#rov.event|event]] and the [[#rov.position|positions]] nearest the start and end times of the event.
 
{| class="wikitable"
|+ Columns in "evt_pos"
|-
! Name !! Type !! Nullable !! Documentation
|-
| end_diff || interval || False || [None]
|-
| end_position_id || integer || False || The link to the [[#rov.position|position]] nearest the event's end time, or null if one is not supplied.
|-
| event_id || integer || False || The link to the [[#rov.event|event's]]'s event ID.
|-
| start_diff || interval || False || [None]
|-
| start_position_id || integer || False || The link to the [[#rov.position|position]] nearest the event's start time.
|}
 
<span id="rov.measurement_position"></span>
=== Materialized View: measurement_position ===
 
Creates a relation between a [[#rov.measurement|measurement]] and the temporally-nearest [[#rov.position|position]].
 
{| class="wikitable"
|+ Columns in "measurement_position"
|-
! Name !! Type !! Nullable !! Documentation
|-
| measurement_id || integer || False || The link to the [[#rov.measurement|measurement]].
|-
| position_id || integer || False || The link to the [[#rov.position|position]].
|}
 
== Schema: shared ==
 
<span id="shared"></span>
<span id="shared.db_version"></span>
=== Table: db_version ===
 
Stores the current database version so that upgrade scripts can perform migrations appropriately.
 
{| class="wikitable"
|+ Columns in "db_version"
|-
! Name !! Type !! Nullable !! Documentation
|-
| revision || integer || NO || The revision number.
|-
| updated_on || timestamp without time zone || NO || The time the upgrade was performed.
|-
| version_major || integer || NO || The major version.
|-
| version_minor || integer || NO || The minor version number.
|}
 
<span id="shared.file"></span>
=== Table: file ===
 
Stores a record of a file object and its location on disk, along with some metadata. This entity is used by all other entities in all schemas that refer to a file object. This should make it easier to audit file stores and e.g., find duplicates using the hash.
 
{| class="wikitable"
|+ Columns in "file"
|-
! Name !! Type !! Nullable !! Documentation
|-
| blob_url || character varying || YES || A URL referencing the file in online blob storage. This field is subject to change depending on where the files reside and will change if they're moved.
|-
| created_on || timestamp without time zone || NO || The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
|-
| description || text || YES || An optional description for the file.
|-
| file_type_id || integer || YES || An optional reference to the [[#shared.file_type|file type]].
|-
| hash || character varying || NO || And MD5 hash of the file data. Used to compare files and search for identical versions.
|-
| metadata || jsonb || YES || A JSON dictionary containing metadata relating to the file.
|-
| name || character varying || NO || The name for the file.
|-
| path || character varying || NO || A path of the file, relative to the root directory where files are stored.
|-
| updated_on || timestamp without time zone || NO || The update time of the file record, not necessarily the file itself (this should be stored in metadata).
|}
 
<span id="shared.file_type"></span>
=== Table: file_type ===
 
A list of file types.
 
{| class="wikitable"
|+ Columns in "file_type"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the file type.
|-
| short_code || character varying || NO || A short code for referencing the file type in import documents.
|}
 
<span id="shared.hart_taxon"></span>
=== Table: hart_taxon ===
 
Species from wherever the Hart codes are from? This table contains records loaded from the VideoMiner species table. This appears to be related to whatever the source of Hart codes is, but at this point VM is the only source. If the name needs to be changed in the future, so be it. Records in this table have a one-to-one relationship with records in the [[#shared.taxon|taxon]] table, and it serves as a metadata table for records stored there.
 
{| class="wikitable"
|+ Columns in "hart_taxon"
|-
! Name !! Type !! Nullable !! Documentation
|-
| authority || text || YES || The identification authority.
|-
| common_name || character varying || YES || The common name.
|-
| from_date || date || YES || ?
|-
| grouping_id || integer || YES || The grouping. * B - Bird * F - Fish * I - Invertebrate * M - Mammal * O - Object? * R - Reptile
|-
| latin_name || character varying || YES || The Latin name of the item, which is distinct in this table from the scientific name. Appears to be informal, and not necessarily Latin.
|-
| nodc_code_v7 || real || YES || The NODC code, v7.
|-
| nodc_code_v8 || integer || YES || The NODC code, V8. Identical to the ITIS ID.
|-
| rank_id || integer || YES || A three-letter code indicating the taxonomic level.
|-
| scientific_name || character varying || YES || The scientific (e.g., Linnean) name.
|-
| sp_species_code || character varying || YES || Another species code whose purpose/origin is not known.
|-
| species_code || character varying || NO || The species, or Hart, code.
|-
| species_prov_code || character varying || YES || ?
|-
| taxa_reference || text || YES || The reference for the identification.
|-
| to_date || date || YES || ?
|}
 
<span id="shared.library"></span>
=== Table: library ===
 
This table stores a partial record of documents, books and papers that can be referenced by other entities. The ISBN and DOI fields are set to unique, but these may vary (in representation, at least) for a single document so care should be taken not to add duplicates. However, updated papers with the same title and author, but different date, are not disallowed.
 
{| class="wikitable"
|+ Columns in "library"
|-
! Name !! Type !! Nullable !! Documentation
|-
| abstract || text || YES || The abstract of the entry.
|-
| authors || jsonb || YES || The (list of) author(s) of the document. This is a JSON list of objects containing whatever information is necessary. Authors should be listed with at least first_name and last_name, and any other relevant information, such as email or institution.
|-
| created_on || timestamp without time zone || YES || The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
|-
| doi || character varying || YES || The DOI of the document.
|-
| file_id || integer || NO || An optional reference to a [[#shared.file|file]].
|-
| institution || character varying || YES || The name of the institution or publisher responsible for the document.
|-
| isbn || character varying || YES || The ISBN of the book, if it is a book.
|-
| issn || character varying || YES || The ISSN of the entry.
|-
| keywords || jsonb || YES || A list of keywords relating to the entry.
|-
| mendeley_id || character varying || YES || The ID of the record in Mendeley.
|-
| publication || character varying || YES || The name of the publication in which the document appeared.
|-
| title || text || NO || The title of the book, paper, or other document.
|-
| type || character varying || YES || Describes the type of entry: book, article, etc.
|-
| updated_on || timestamp without time zone || YES || The update time of the file record, not necessarily the file itself (this should be stored in metadata).
|-
| year || character varying || YES || The publishing date of the document.
|}
 
<span id="shared.mseauser"></span>
=== Table: mseauser ===
 
Represents an MSEA user and is linked to a single Django auth User. Stores extra application-related properties such as the Biigle API key.
 
{| class="wikitable"
|+ Columns in "mseauser"
|-
! Name !! Type !! Nullable !! Documentation
|-
| biigle_api_key || character varying || YES || The Biigle API key.
|-
| biigle_username || character varying || YES || The Biigle username.
|-
| pg_role || character varying || YES || The name of the PostgreSQL role that the user will use to log in directly to the database.
|-
| user_id || integer || NO || A reference to the [[#public.auth_user|Django user]].
|}
 
<span id="shared.mseauser_restriction"></span>
=== Table: mseauser_restriction ===
 
Links an [[#shared.mseauser|MSEA user]] to a [[#shared.restriction|restriction]]. The user will have access to records related to this group.
 
{| class="wikitable"
|+ Columns in "mseauser_restriction"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || The creation time of the record.
|-
| mseauser_id || integer || NO || The ID of the [[#shared.mseauser|MSEA user]].
|-
| restriction_id || integer || NO || The ID of the [[#shared.restriction|restriction]].
|-
| updated_on || timestamp without time zone || NO || The last update time of the record.
|}
 
<span id="shared.news_item"></span>
=== Table: news_item ===
 
A table for news items related to each sub-site.
 
{| class="wikitable"
|+ Columns in "news_item"
|-
! Name !! Type !! Nullable !! Documentation
|-
| content || text || NO || The content of the item.
|-
| created_on || timestamp without time zone || NO || The date of creation of the item.
|-
| sites || character varying || YES || An optional comma-delimited list of sites the item refers to. The current list is 'rca', 'rov', 'intertidal'. Leave empty to apply to all sites. TODO: Currently not standardized or enforced.
|-
| title || character varying || NO || A title for the item.
|}
 
<span id="shared.organisation"></span>
=== Table: organisation ===
 
Convenient storage for organisations involved in MSEA activities.
 
{| class="wikitable"
|+ Columns in "organisation"
|-
! Name !! Type !! Nullable !! Documentation
|-
| country || character varying || NO || The code for the country where the organisation is based (e.g., "CA" for Canada).
|-
| name || character varying || NO || The full name of the organisation.
|-
| note || text || YES || An optional note about the organisation.
|-
| short_code || character varying || NO || A short code for looking up the entity; usually the organisation's acronym.
|}
 
<span id="shared.person"></span>
=== Table: person ===
 
Stores information about people involved in all aspects of the application. This is not intended to be a comprehensive duplicate of the individual's HR dossier, just a means of representing a person and providing a means of associating it with a real-world individual, e.g., by their email.
 
{| class="wikitable"
|+ Columns in "person"
|-
! Name !! Type !! Nullable !! Documentation
|-
| biigle_user_id || integer || YES || The Biigle database ID of a user. The UUID should be used instead.
|-
| biigle_uuid || character || YES || The Biigle UUID is used to identify the user in Biigle apps.
|-
| bio || text || YES || A brief biography of the person.
|-
| email || character varying || NO || Email address.
|-
| first_name || character varying || NO || First name.
|-
| last_name || character varying || NO || Last name.
|-
| photo || bytea || YES || A photo of the person.
|}
 
<span id="shared.restriction"></span>
=== Table: restriction ===
 
Provides a list of restrictions that can be applied to individual observation rows, to restrict access to allowed roles.
 
{| class="wikitable"
|+ Columns in "restriction"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || The creation time of the restriction.
|-
| name || character varying || NO || The name of the restriction.
|-
| note || text || YES || An optional note about the restriction.
|-
| short_code || character varying || NO || A short code used to reference the restriction.
|-
| updated_on || timestamp without time zone || NO || The last update time of the restriction.
|}
 
<span id="shared.site"></span>
=== Table: site ===
 
Contains the names and geographic boundaries of study sites. This will be useful not only for mapping but for querying data by spatial extent.
 
{| class="wikitable"
|+ Columns in "site"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || A name for the site.
|-
| note || text || YES || An optional note about the site.
|-
| spatial_library_id || integer || YES || A reference to the [[#shared.spatial_library|spatial library]] entry.
|}
 
<span id="shared.spatial_library"></span>
=== Table: spatial_library ===
 
Maintains a library of spatial data.
 
{| class="wikitable"
|+ Columns in "spatial_library"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || The time when this record was created.
|-
| file_id || integer || YES || A reference to a related [[#shared.file|file]].
|-
| geom || geometry || YES || A vector representation of the object(s), projected into WGS84 (lat/lon) and stored as a geography type.
|-
| metadata || jsonb || YES || A JSON object containing metadata related to the spatial object.
|-
| name || character varying || NO || A name for the entry.
|-
| note || text || YES || A note about this library item.
|-
| rast || bytea || YES || A raster.
|-
| thumbnail || bytea || YES || A small thumbnail in binary (JPG) form.
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}
 
<span id="shared.spatial_library_file"></span>
=== Table: spatial_library_file ===
 
Allows a [[#shared.spatial_library|spatial library]] entity to own more than one file.
 
{| class="wikitable"
|+ Columns in "spatial_library_file"
|-
! Name !! Type !! Nullable !! Documentation
|-
| file_id || integer || NO || A link to the [[#shared.file|file]].
|-
| spatial_library_id || integer || NO || A link to the [[#shared.spatial_library|spatial library]].
|}
 
<span id="shared.survey_suggestion"></span>
=== Table: survey_suggestion ===
 
A table of suggestions supplied by users for upgrades to the database.
 
{| class="wikitable"
|+ Columns in "survey_suggestion"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || [None]
|-
| down_votes || integer || NO || A count of the down votes on the suggestion.
|-
| email || character varying || YES || The email of the suggesting user.
|-
| screen_name || character varying || YES || A screen name for the suggesting user.
|-
| suggestion || text || NO || The text of the suggestion.
|-
| up_votes || integer || NO || A count of the up votes on the suggestion.
|}
 
<span id="shared.taxon"></span>
=== Table: taxon ===
 
The taxon table stores information about the identification of observed specimens. A taxon record stores the name of the taxonomic unit (e.g., the species or genus name), or an open nomenclature (ON) identifier using *sp.* or *cf.*; an optional operational taxonomic unit (OTU), and a reference to any known taxa in the Hart, ITIS, iNaturalist or WoRMS databases. The original label stores the name as imported. The label, OTU and Hart code are updated at audit time from the original label and the scientific and common names are updated if available. The auditing process is necessary to produce reasonable data. Some of this work can be performed automatically. Multiple records in this table can refer to the same species or subspecies. It *may or may not be known whether the species referred to by a record are the same or different.* Some amount of auditing will probably be necessary on this table. The contents of this table are driven by observations; it is not populated from existing catalogues but from observations, and the authoritative entity IDs are populated as a post-processing step from existing catalogs. If a match in one of the authoritative catalogue is not found, the relation fields are left empty and the taxon should be audited, to correct spelling or assign a correct identifier.
 
{| class="wikitable"
|+ Columns in "taxon"
|-
! Name !! Type !! Nullable !! Documentation
|-
| aphia_id || integer || YES || A reference to the [https://www.marinespecies.org/ WoRMs] database. The actual Aphia ID used by WoRMs is used as the primary key in the [[#rov.worms_taxon|WoRMs taxon]] table.
|-
| common_name || character varying || YES || The common name of the taxon.
|-
| hart_code || character varying || YES || Used when there's not ref in the hart code table.
|-
| hart_id || integer || YES || A reference to the [[#shared.hart_taxon|Hart code table]]. This is an identification with species used by VideoMiner and other tools that use that list.
|-
| inaturalist_id || integer || YES || A reference to the [https://www.inaturalist.org/projects/marine-life-of-the-northeast-pacific iNaturalist] taxon. The iNaturalist taxon ID is used as the primary key in the [[#rov.inaturalist_taxon|iNaturalist taxon]] table.
|-
| label || character varying || YES || The label given to the species at audit time. May be modified from the original label. May differ from the scientific or common names.
|-
| original_label || character varying || NO || The original label as entered by the annotator or observer. On review or audit, the label, hart_code and otu fields will be populated and references to outside databases updated. This field will not be edited.
|-
| otu || character varying || YES || The operational taxonomic unit is a unique identifier for this instances of an observation whose identification isn't certain.
|-
| review_note || text || YES || Optional note about the review.
|-
| reviewed_by_id || integer || YES || Relates to the [[#rov.person|person]] who reviewed the record.
|-
| reviewed_on || timestamp without time zone || YES || Gives the time that the record was reviewed.
|-
| scientific_name || character varying || YES || The scientific (binomial, trinomial) name of the taxon. Updated at audit time, based on the label or other fields.
|}
 
<span id="shared.taxon_restriction"></span>
=== Table: taxon_restriction ===
 
Links an [[#shared.mseauser|MSEA user]] to a [[#shared.restriction|restriction]]. The user will have access to records related to this group.
 
{| class="wikitable"
|+ Columns in "taxon_restriction"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || The creation time of the record.
|-
| restriction_id || integer || NO || The ID of the [[#shared.restriction|restriction]].
|-
| taxon_id || integer || NO || The ID of the [[#shared.taxon|taxon]].
|-
| updated_on || timestamp without time zone || NO || The last update time of the record.
|}
 
<span id="shared.taxonomic_grouping"></span>
=== Table: taxonomic_grouping ===
 
Provides a lookup for the taxonomic grouping (Invertebrate, Fish, etc.) Used by VideoMiner.
 
{| class="wikitable"
|+ Columns in "taxonomic_grouping"
|-
! Name !! Type !! Nullable !! Documentation
|-
| code || character || YES || A one-letter code for the grouping.
|-
| name || character varying || NO || The name of the taxonomic grouping.
|-
| note || text || YES || A note about the taxonomic grouping.
|}
 
<span id="shared.taxonomic_rank"></span>
=== Table: taxonomic_rank ===
 
Provides a lookup for the taxonomic rank (Kingdom, Class, Species, etc.) Used by VideoMiner.
 
{| class="wikitable"
|+ Columns in "taxonomic_rank"
|-
! Name !! Type !! Nullable !! Documentation
|-
| code || character || YES || A three-letter code for the rank.
|-
| name || character varying || NO || The name of the taxonomic rank.
|-
| note || text || YES || A note about the taxonomic rank.
|}
 
<span id="shared.uploaded_file"></span>
=== Table: uploaded_file ===
 
A table to store uploaded files that can be associated with other entities in separate requests. This table is intended to store temporary entities: when an uploaded file has been handled, these records should be deleted.
 
{| class="wikitable"
|+ Columns in "uploaded_file"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
|-
| expires_on || timestamp without time zone || NO || The expiry time of the file. It may be deleted by a maintenance script after this time.
|-
| name || character varying || NO || The original name of the file.
|-
| path || character varying || NO || The path to the temporary location of the file.
|-
| type || character varying || NO || The guessed MIME type of the file.
|}
 
== Schema: wiki ==
 
<span id="wiki"></span>
<span id="wiki.actor"></span>
=== Table: actor ===
 
None
 
{| class="wikitable"
|+ Columns in "actor"
|-
! Name !! Type !! Nullable !! Documentation
|-
| actor_id || bigint || NO || [None]
|-
| actor_name || text || NO || [None]
|-
| actor_user || integer || YES || [None]
|}
 
<span id="wiki.archive"></span>
=== Table: archive ===
 
None
 
{| class="wikitable"
|+ Columns in "archive"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ar_actor || bigint || NO || [None]
|-
| ar_comment_id || bigint || NO || [None]
|-
| ar_deleted || smallint || NO || [None]
|-
| ar_id || integer || NO || [None]
|-
| ar_len || integer || YES || [None]
|-
| ar_minor_edit || smallint || NO || [None]
|-
| ar_namespace || integer || NO || [None]
|-
| ar_page_id || integer || YES || [None]
|-
| ar_parent_id || integer || YES || [None]
|-
| ar_rev_id || integer || NO || [None]
|-
| ar_sha1 || text || NO || [None]
|-
| ar_timestamp || timestamp with time zone || NO || [None]
|-
| ar_title || text || NO || [None]
|}
 
<span id="wiki.bot_passwords"></span>
=== Table: bot_passwords ===
 
None
 
{| class="wikitable"
|+ Columns in "bot_passwords"
|-
! Name !! Type !! Nullable !! Documentation
|-
| bp_app_id || text || NO || [None]
|-
| bp_grants || text || NO || [None]
|-
| bp_password || text || NO || [None]
|-
| bp_restrictions || text || NO || [None]
|-
| bp_token || text || NO || [None]
|-
| bp_user || integer || NO || [None]
|}
 
<span id="wiki.category"></span>
=== Table: category ===
 
None
 
{| class="wikitable"
|+ Columns in "category"
|-
! Name !! Type !! Nullable !! Documentation
|-
| cat_files || integer || NO || [None]
|-
| cat_id || integer || NO || [None]
|-
| cat_pages || integer || NO || [None]
|-
| cat_subcats || integer || NO || [None]
|-
| cat_title || text || NO || [None]
|}
 
<span id="wiki.categorylinks"></span>
=== Table: categorylinks ===
 
None
 
{| class="wikitable"
|+ Columns in "categorylinks"
|-
! Name !! Type !! Nullable !! Documentation
|-
| cl_collation || text || NO || [None]
|-
| cl_from || integer || NO || [None]
|-
| cl_sortkey || text || NO || [None]
|-
| cl_sortkey_prefix || text || NO || [None]
|-
| cl_timestamp || timestamp with time zone || NO || [None]
|-
| cl_to || text || NO || [None]
|-
| cl_type || text || NO || [None]
|}
 
<span id="wiki.change_tag"></span>
=== Table: change_tag ===
 
None
 
{| class="wikitable"
|+ Columns in "change_tag"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ct_id || integer || NO || [None]
|-
| ct_log_id || integer || YES || [None]
|-
| ct_params || text || YES || [None]
|-
| ct_rc_id || integer || YES || [None]
|-
| ct_rev_id || integer || YES || [None]
|-
| ct_tag_id || integer || NO || [None]
|}
 
<span id="wiki.change_tag_def"></span>
=== Table: change_tag_def ===
 
None
 
{| class="wikitable"
|+ Columns in "change_tag_def"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ctd_count || bigint || NO || [None]
|-
| ctd_id || integer || NO || [None]
|-
| ctd_name || text || NO || [None]
|-
| ctd_user_defined || smallint || NO || [None]
|}
 
<span id="wiki.comment"></span>
=== Table: comment ===
 
None
 
{| class="wikitable"
|+ Columns in "comment"
|-
! Name !! Type !! Nullable !! Documentation
|-
| comment_data || text || YES || [None]
|-
| comment_hash || integer || NO || [None]
|-
| comment_id || bigint || NO || [None]
|-
| comment_text || text || NO || [None]
|}
 
<span id="wiki.content"></span>
=== Table: content ===
 
None
 
{| class="wikitable"
|+ Columns in "content"
|-
! Name !! Type !! Nullable !! Documentation
|-
| content_address || text || NO || [None]
|-
| content_id || bigint || NO || [None]
|-
| content_model || smallint || NO || [None]
|-
| content_sha1 || text || NO || [None]
|-
| content_size || integer || NO || [None]
|}
 
<span id="wiki.content_models"></span>
=== Table: content_models ===
 
None
 
{| class="wikitable"
|+ Columns in "content_models"
|-
! Name !! Type !! Nullable !! Documentation
|-
| model_id || integer || NO || [None]
|-
| model_name || text || NO || [None]
|}
 
<span id="wiki.externallinks"></span>
=== Table: externallinks ===
 
None
 
{| class="wikitable"
|+ Columns in "externallinks"
|-
! Name !! Type !! Nullable !! Documentation
|-
| el_from || integer || NO || [None]
|-
| el_id || integer || NO || [None]
|-
| el_index || text || NO || [None]
|-
| el_index_60 || text || NO || [None]
|-
| el_to || text || NO || [None]
|-
| el_to_domain_index || text || NO || [None]
|-
| el_to_path || text || YES || [None]
|}
 
<span id="wiki.filearchive"></span>
=== Table: filearchive ===
 
None
 
{| class="wikitable"
|+ Columns in "filearchive"
|-
! Name !! Type !! Nullable !! Documentation
|-
| fa_actor || bigint || NO || [None]
|-
| fa_archive_name || text || YES || [None]
|-
| fa_bits || integer || YES || [None]
|-
| fa_deleted || smallint || NO || [None]
|-
| fa_deleted_reason_id || bigint || NO || [None]
|-
| fa_deleted_timestamp || timestamp with time zone || YES || [None]
|-
| fa_deleted_user || integer || YES || [None]
|-
| fa_description_id || bigint || NO || [None]
|-
| fa_height || integer || YES || [None]
|-
| fa_id || integer || NO || [None]
|-
| fa_major_mime || text || YES || [None]
|-
| fa_media_type || text || YES || [None]
|-
| fa_metadata || text || YES || [None]
|-
| fa_minor_mime || text || YES || [None]
|-
| fa_name || text || NO || [None]
|-
| fa_sha1 || text || NO || [None]
|-
| fa_size || integer || YES || [None]
|-
| fa_storage_group || text || YES || [None]
|-
| fa_storage_key || text || YES || [None]
|-
| fa_timestamp || timestamp with time zone || YES || [None]
|-
| fa_width || integer || YES || [None]
|}
 
<span id="wiki.image"></span>
=== Table: image ===
 
None
 
{| class="wikitable"
|+ Columns in "image"
|-
! Name !! Type !! Nullable !! Documentation
|-
| img_actor || bigint || NO || [None]
|-
| img_bits || integer || NO || [None]
|-
| img_description_id || bigint || NO || [None]
|-
| img_height || integer || NO || [None]
|-
| img_major_mime || text || NO || [None]
|-
| img_media_type || text || YES || [None]
|-
| img_metadata || text || NO || [None]
|-
| img_minor_mime || text || NO || [None]
|-
| img_name || text || NO || [None]
|-
| img_sha1 || text || NO || [None]
|-
| img_size || integer || NO || [None]
|-
| img_timestamp || timestamp with time zone || NO || [None]
|-
| img_width || integer || NO || [None]
|}
 
<span id="wiki.imagelinks"></span>
=== Table: imagelinks ===
 
None
 
{| class="wikitable"
|+ Columns in "imagelinks"
|-
! Name !! Type !! Nullable !! Documentation
|-
| il_from || integer || NO || [None]
|-
| il_from_namespace || integer || NO || [None]
|-
| il_to || text || NO || [None]
|}
 
<span id="wiki.interwiki"></span>
=== Table: interwiki ===
 
None
 
{| class="wikitable"
|+ Columns in "interwiki"
|-
! Name !! Type !! Nullable !! Documentation
|-
| iw_api || text || NO || [None]
|-
| iw_local || smallint || NO || [None]
|-
| iw_prefix || character varying || NO || [None]
|-
| iw_trans || smallint || NO || [None]
|-
| iw_url || text || NO || [None]
|-
| iw_wikiid || character varying || NO || [None]
|}
 
<span id="wiki.ip_changes"></span>
=== Table: ip_changes ===
 
None
 
{| class="wikitable"
|+ Columns in "ip_changes"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ipc_hex || text || NO || [None]
|-
| ipc_rev_id || integer || NO || [None]
|-
| ipc_rev_timestamp || timestamp with time zone || NO || [None]
|}
 
<span id="wiki.ipblocks"></span>
=== Table: ipblocks ===
 
None
 
{| class="wikitable"
|+ Columns in "ipblocks"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ipb_address || text || NO || [None]
|-
| ipb_allow_usertalk || smallint || NO || [None]
|-
| ipb_anon_only || smallint || NO || [None]
|-
| ipb_auto || smallint || NO || [None]
|-
| ipb_block_email || smallint || NO || [None]
|-
| ipb_by_actor || bigint || NO || [None]
|-
| ipb_create_account || smallint || NO || [None]
|-
| ipb_deleted || smallint || NO || [None]
|-
| ipb_enable_autoblock || smallint || NO || [None]
|-
| ipb_expiry || timestamp with time zone || NO || [None]
|-
| ipb_id || integer || NO || [None]
|-
| ipb_parent_block_id || integer || YES || [None]
|-
| ipb_range_end || text || NO || [None]
|-
| ipb_range_start || text || NO || [None]
|-
| ipb_reason_id || bigint || NO || [None]
|-
| ipb_sitewide || smallint || NO || [None]
|-
| ipb_timestamp || timestamp with time zone || NO || [None]
|-
| ipb_user || integer || NO || [None]
|}
 
<span id="wiki.ipblocks_restrictions"></span>
=== Table: ipblocks_restrictions ===
 
None
 
{| class="wikitable"
|+ Columns in "ipblocks_restrictions"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ir_ipb_id || integer || NO || [None]
|-
| ir_type || smallint || NO || [None]
|-
| ir_value || integer || NO || [None]
|}
 
<span id="wiki.iwlinks"></span>
=== Table: iwlinks ===
 
None
 
{| class="wikitable"
|+ Columns in "iwlinks"
|-
! Name !! Type !! Nullable !! Documentation
|-
| iwl_from || integer || NO || [None]
|-
| iwl_prefix || text || NO || [None]
|-
| iwl_title || text || NO || [None]
|}
 
<span id="wiki.job"></span>
=== Table: job ===
 
None
 
{| class="wikitable"
|+ Columns in "job"
|-
! Name !! Type !! Nullable !! Documentation
|-
| job_attempts || integer || NO || [None]
|-
| job_cmd || text || NO || [None]
|-
| job_id || integer || NO || [None]
|-
| job_namespace || integer || NO || [None]
|-
| job_params || text || NO || [None]
|-
| job_random || integer || NO || [None]
|-
| job_sha1 || text || NO || [None]
|-
| job_timestamp || timestamp with time zone || YES || [None]
|-
| job_title || text || NO || [None]
|-
| job_token || text || NO || [None]
|-
| job_token_timestamp || timestamp with time zone || YES || [None]
|}
 
<span id="wiki.l10n_cache"></span>
=== Table: l10n_cache ===
 
None
 
{| class="wikitable"
|+ Columns in "l10n_cache"
|-
! Name !! Type !! Nullable !! Documentation
|-
| lc_key || character varying || NO || [None]
|-
| lc_lang || text || NO || [None]
|-
| lc_value || text || NO || [None]
|}
 
<span id="wiki.langlinks"></span>
=== Table: langlinks ===
 
None
 
{| class="wikitable"
|+ Columns in "langlinks"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ll_from || integer || NO || [None]
|-
| ll_lang || text || NO || [None]
|-
| ll_title || text || NO || [None]
|}
 
<span id="wiki.linktarget"></span>
=== Table: linktarget ===
 
None
 
{| class="wikitable"
|+ Columns in "linktarget"
|-
! Name !! Type !! Nullable !! Documentation
|-
| lt_id || bigint || NO || [None]
|-
| lt_namespace || integer || NO || [None]
|-
| lt_title || text || NO || [None]
|}
 
<span id="wiki.log_search"></span>
=== Table: log_search ===
 
None
 
{| class="wikitable"
|+ Columns in "log_search"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ls_field || text || NO || [None]
|-
| ls_log_id || integer || NO || [None]
|-
| ls_value || character varying || NO || [None]
|}
 
<span id="wiki.logging"></span>
=== Table: logging ===
 
None
 
{| class="wikitable"
|+ Columns in "logging"
|-
! Name !! Type !! Nullable !! Documentation
|-
| log_action || text || NO || [None]
|-
| log_actor || bigint || NO || [None]
|-
| log_comment_id || bigint || NO || [None]
|-
| log_deleted || smallint || NO || [None]
|-
| log_id || integer || NO || [None]
|-
| log_namespace || integer || NO || [None]
|-
| log_page || integer || YES || [None]
|-
| log_params || text || NO || [None]
|-
| log_timestamp || timestamp with time zone || NO || [None]
|-
| log_title || text || NO || [None]
|-
| log_type || text || NO || [None]
|}
 
<span id="wiki.module_deps"></span>
=== Table: module_deps ===
 
None
 
{| class="wikitable"
|+ Columns in "module_deps"
|-
! Name !! Type !! Nullable !! Documentation
|-
| md_deps || text || NO || [None]
|-
| md_module || text || NO || [None]
|-
| md_skin || text || NO || [None]
|}
 
<span id="wiki.objectcache"></span>
=== Table: objectcache ===
 
None
 
{| class="wikitable"
|+ Columns in "objectcache"
|-
! Name !! Type !! Nullable !! Documentation
|-
| exptime || timestamp with time zone || NO || [None]
|-
| flags || integer || YES || [None]
|-
| keyname || text || NO || [None]
|-
| modtoken || character varying || NO || [None]
|-
| value || text || YES || [None]
|}
 
<span id="wiki.oldimage"></span>
=== Table: oldimage ===
 
None
 
{| class="wikitable"
|+ Columns in "oldimage"
|-
! Name !! Type !! Nullable !! Documentation
|-
| oi_actor || bigint || NO || [None]
|-
| oi_archive_name || text || NO || [None]
|-
| oi_bits || integer || NO || [None]
|-
| oi_deleted || smallint || NO || [None]
|-
| oi_description_id || bigint || NO || [None]
|-
| oi_height || integer || NO || [None]
|-
| oi_major_mime || text || NO || [None]
|-
| oi_media_type || text || YES || [None]
|-
| oi_metadata || text || NO || [None]
|-
| oi_minor_mime || text || NO || [None]
|-
| oi_name || text || NO || [None]
|-
| oi_sha1 || text || NO || [None]
|-
| oi_size || integer || NO || [None]
|-
| oi_timestamp || timestamp with time zone || NO || [None]
|-
| oi_width || integer || NO || [None]
|}
 
<span id="wiki.page"></span>
=== Table: page ===
 
None
 
{| class="wikitable"
|+ Columns in "page"
|-
! Name !! Type !! Nullable !! Documentation
|-
| page_content_model || text || YES || [None]
|-
| page_id || integer || NO || [None]
|-
| page_is_new || smallint || NO || [None]
|-
| page_is_redirect || smallint || NO || [None]
|-
| page_lang || text || YES || [None]
|-
| page_latest || integer || NO || [None]
|-
| page_len || integer || NO || [None]
|-
| page_links_updated || timestamp with time zone || YES || [None]
|-
| page_namespace || integer || NO || [None]
|-
| page_random || double precision || NO || [None]
|-
| page_title || text || NO || [None]
|-
| page_touched || timestamp with time zone || NO || [None]
|-
| titlevector || tsvector || YES || [None]
|}
 
<span id="wiki.page_props"></span>
=== Table: page_props ===
 
None
 
{| class="wikitable"
|+ Columns in "page_props"
|-
! Name !! Type !! Nullable !! Documentation
|-
| pp_page || integer || NO || [None]
|-
| pp_propname || text || NO || [None]
|-
| pp_sortkey || double precision || YES || [None]
|-
| pp_value || text || NO || [None]
|}
 
<span id="wiki.page_restrictions"></span>
=== Table: page_restrictions ===
 
None
 
{| class="wikitable"
|+ Columns in "page_restrictions"
|-
! Name !! Type !! Nullable !! Documentation
|-
| pr_cascade || smallint || NO || [None]
|-
| pr_expiry || timestamp with time zone || YES || [None]
|-
| pr_id || integer || NO || [None]
|-
| pr_level || text || NO || [None]
|-
| pr_page || integer || NO || [None]
|-
| pr_type || text || NO || [None]
|}
 
<span id="wiki.pagelinks"></span>
=== Table: pagelinks ===
 
None
 
{| class="wikitable"
|+ Columns in "pagelinks"
|-
! Name !! Type !! Nullable !! Documentation
|-
| pl_from || integer || NO || [None]
|-
| pl_from_namespace || integer || NO || [None]
|-
| pl_namespace || integer || NO || [None]
|-
| pl_title || text || NO || [None]
|}
 
<span id="wiki.protected_titles"></span>
=== Table: protected_titles ===
 
None
 
{| class="wikitable"
|+ Columns in "protected_titles"
|-
! Name !! Type !! Nullable !! Documentation
|-
| pt_create_perm || text || NO || [None]
|-
| pt_expiry || timestamp with time zone || NO || [None]
|-
| pt_namespace || integer || NO || [None]
|-
| pt_reason_id || bigint || NO || [None]
|-
| pt_timestamp || timestamp with time zone || NO || [None]
|-
| pt_title || text || NO || [None]
|-
| pt_user || integer || NO || [None]
|}
 
<span id="wiki.querycache"></span>
=== Table: querycache ===
 
None
 
{| class="wikitable"
|+ Columns in "querycache"
|-
! Name !! Type !! Nullable !! Documentation
|-
| qc_namespace || integer || NO || [None]
|-
| qc_title || text || NO || [None]
|-
| qc_type || text || NO || [None]
|-
| qc_value || integer || NO || [None]
|}
 
<span id="wiki.querycache_info"></span>
=== Table: querycache_info ===
 
None
 
{| class="wikitable"
|+ Columns in "querycache_info"
|-
! Name !! Type !! Nullable !! Documentation
|-
| qci_timestamp || timestamp with time zone || NO || [None]
|-
| qci_type || text || NO || [None]
|}
 
<span id="wiki.querycachetwo"></span>
=== Table: querycachetwo ===
 
None
 
{| class="wikitable"
|+ Columns in "querycachetwo"
|-
! Name !! Type !! Nullable !! Documentation
|-
| qcc_namespace || integer || NO || [None]
|-
| qcc_namespacetwo || integer || NO || [None]
|-
| qcc_title || text || NO || [None]
|-
| qcc_titletwo || text || NO || [None]
|-
| qcc_type || text || NO || [None]
|-
| qcc_value || integer || NO || [None]
|}
 
<span id="wiki.recentchanges"></span>
=== Table: recentchanges ===
 
None
 
{| class="wikitable"
|+ Columns in "recentchanges"
|-
! Name !! Type !! Nullable !! Documentation
|-
| rc_actor || bigint || NO || [None]
|-
| rc_bot || smallint || NO || [None]
|-
| rc_comment_id || bigint || NO || [None]
|-
| rc_cur_id || integer || NO || [None]
|-
| rc_deleted || smallint || NO || [None]
|-
| rc_id || integer || NO || [None]
|-
| rc_ip || text || NO || [None]
|-
| rc_last_oldid || integer || NO || [None]
|-
| rc_log_action || text || YES || [None]
|-
| rc_log_type || text || YES || [None]
|-
| rc_logid || integer || NO || [None]
|-
| rc_minor || smallint || NO || [None]
|-
| rc_namespace || integer || NO || [None]
|-
| rc_new || smallint || NO || [None]
|-
| rc_new_len || integer || YES || [None]
|-
| rc_old_len || integer || YES || [None]
|-
| rc_params || text || YES || [None]
|-
| rc_patrolled || smallint || NO || [None]
|-
| rc_source || text || NO || [None]
|-
| rc_this_oldid || integer || NO || [None]
|-
| rc_timestamp || timestamp with time zone || NO || [None]
|-
| rc_title || text || NO || [None]
|-
| rc_type || smallint || NO || [None]
|}
 
<span id="wiki.redirect"></span>
=== Table: redirect ===
 
None
 
{| class="wikitable"
|+ Columns in "redirect"
|-
! Name !! Type !! Nullable !! Documentation
|-
| rd_fragment || text || YES || [None]
|-
| rd_from || integer || NO || [None]
|-
| rd_interwiki || character varying || YES || [None]
|-
| rd_namespace || integer || NO || [None]
|-
| rd_title || text || NO || [None]
|}
 
<span id="wiki.revision"></span>
=== Table: revision ===
 
None
 
{| class="wikitable"
|+ Columns in "revision"
|-
! Name !! Type !! Nullable !! Documentation
|-
| rev_actor || bigint || NO || [None]
|-
| rev_comment_id || bigint || NO || [None]
|-
| rev_deleted || smallint || NO || [None]
|-
| rev_id || integer || NO || [None]
|-
| rev_len || integer || YES || [None]
|-
| rev_minor_edit || smallint || NO || [None]
|-
| rev_page || integer || NO || [None]
|-
| rev_parent_id || integer || YES || [None]
|-
| rev_sha1 || text || NO || [None]
|-
| rev_timestamp || timestamp with time zone || NO || [None]
|}
 
<span id="wiki.revision_comment_temp"></span>
=== Table: revision_comment_temp ===
 
None
 
{| class="wikitable"
|+ Columns in "revision_comment_temp"
|-
! Name !! Type !! Nullable !! Documentation
|-
| revcomment_comment_id || bigint || NO || [None]
|-
| revcomment_rev || integer || NO || [None]
|}
 
<span id="wiki.searchindex"></span>
=== Table: searchindex ===
 
None
 
{| class="wikitable"
|+ Columns in "searchindex"
|-
! Name !! Type !! Nullable !! Documentation
|-
| si_page || integer || NO || [None]
|-
| si_text || text || NO || [None]
|-
| si_title || character varying || NO || [None]
|}
 
<span id="wiki.site_identifiers"></span>
=== Table: site_identifiers ===
 
None
 
{| class="wikitable"
|+ Columns in "site_identifiers"
|-
! Name !! Type !! Nullable !! Documentation
|-
| si_key || text || NO || [None]
|-
| si_site || integer || NO || [None]
|-
| si_type || text || NO || [None]
|}
 
<span id="wiki.site_stats"></span>
=== Table: site_stats ===
 
None
 
{| class="wikitable"
|+ Columns in "site_stats"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ss_active_users || bigint || YES || [None]
|-
| ss_good_articles || bigint || YES || [None]
|-
| ss_images || bigint || YES || [None]
|-
| ss_row_id || integer || NO || [None]
|-
| ss_total_edits || bigint || YES || [None]
|-
| ss_total_pages || bigint || YES || [None]
|-
| ss_users || bigint || YES || [None]
|}
 
<span id="wiki.sites"></span>
=== Table: sites ===
 
None
 
{| class="wikitable"
|+ Columns in "sites"
|-
! Name !! Type !! Nullable !! Documentation
|-
| site_config || text || NO || [None]
|-
| site_data || text || NO || [None]
|-
| site_domain || character varying || NO || [None]
|-
| site_forward || smallint || NO || [None]
|-
| site_global_key || text || NO || [None]
|-
| site_group || text || NO || [None]
|-
| site_id || integer || NO || [None]
|-
| site_language || text || NO || [None]
|-
| site_protocol || text || NO || [None]
|-
| site_source || text || NO || [None]
|-
| site_type || text || NO || [None]
|}
 
<span id="wiki.slot_roles"></span>
=== Table: slot_roles ===
 
None
 
{| class="wikitable"
|+ Columns in "slot_roles"
|-
! Name !! Type !! Nullable !! Documentation
|-
| role_id || integer || NO || [None]
|-
| role_name || text || NO || [None]
|}
 
<span id="wiki.slots"></span>
=== Table: slots ===
 
None
 
{| class="wikitable"
|+ Columns in "slots"
|-
! Name !! Type !! Nullable !! Documentation
|-
| slot_content_id || bigint || NO || [None]
|-
| slot_origin || bigint || NO || [None]
|-
| slot_revision_id || bigint || NO || [None]
|-
| slot_role_id || smallint || NO || [None]
|}
 
<span id="wiki.templatelinks"></span>
=== Table: templatelinks ===
 
None
 
{| class="wikitable"
|+ Columns in "templatelinks"
|-
! Name !! Type !! Nullable !! Documentation
|-
| tl_from || integer || NO || [None]
|-
| tl_from_namespace || integer || NO || [None]
|-
| tl_target_id || bigint || NO || [None]
|}
 
<span id="wiki.text"></span>
=== Table: text ===
 
None
 
{| class="wikitable"
|+ Columns in "text"
|-
! Name !! Type !! Nullable !! Documentation
|-
| old_flags || text || NO || [None]
|-
| old_id || integer || NO || [None]
|-
| old_text || text || NO || [None]
|-
| textvector || tsvector || YES || [None]
|}
 
<span id="wiki.updatelog"></span>
=== Table: updatelog ===
 
None
 
{| class="wikitable"
|+ Columns in "updatelog"
|-
|-
! Name !! Type !! Nullable !! Documentation
! Name !! Type !! Nullable !! Documentation
|-
|-
| ul_key || character varying || NO || [None]
| accepted_taxon_id || integer || YES || The taxon ID of the accepted taxon for this unaccepted taxon. If this column is null, the taxon is accepted.
|-
| ul_value || text || YES || [None]
|}
 
<span id="wiki.uploadstash"></span>
=== Table: uploadstash ===
 
None
 
{| class="wikitable"
|+ Columns in "uploadstash"
|-
! Name !! Type !! Nullable !! Documentation
|-
| us_chunk_inx || integer || YES || [None]
|-
| us_id || integer || NO || [None]
|-
| us_image_bits || smallint || YES || [None]
|-
| us_image_height || integer || YES || [None]
|-
| us_image_width || integer || YES || [None]
|-
|-
| us_key || character varying || NO || [None]
| class || character varying || YES || The "class" name.
|-
|-
| us_media_type || USER-DEFINED || YES || [None]
| common_name || character varying || YES || The common name of the species.
|-
|-
| us_mime || character varying || YES || [None]
| domain || character varying || YES || The domain name.
|-
|-
| us_orig_path || character varying || NO || [None]
| family || character varying || YES || The family name.
|-
|-
| us_path || character varying || NO || [None]
| form || character varying || YES || The form name.
|-
|-
| us_props || text || YES || [None]
| genus || character varying || YES || The genus name.
|-
|-
| us_sha1 || character varying || NO || [None]
| genus_hybrid || character varying || YES || The genus hybrid name.
|-
|-
| us_size || integer || NO || [None]
| gigaclass || character varying || YES || The gigaclass name.
|-
|-
| us_source_type || character varying || YES || [None]
| hybrid || character varying || YES || The hybrid name.
|-
|-
| us_status || character varying || NO || [None]
| infraclass || character varying || YES || The infraclass name.
|-
|-
| us_timestamp || timestamp with time zone || NO || [None]
| infrakingdom || character varying || YES || The infrakingdom name.
|-
|-
| us_user || integer || NO || [None]
| infraorder || character varying || YES || The infraorder name.
|}
 
<span id="wiki.user"></span>
=== Table: user ===
 
None
 
{| class="wikitable"
|+ Columns in "user"
|-
|-
! Name !! Type !! Nullable !! Documentation
| infraphylum || character varying || YES || The infraphylum name.
|-
|-
| user_editcount || integer || YES || [None]
| kingdom || character varying || YES || The kingdom name.
|-
|-
| user_email || text || NO || [None]
| megaclass || character varying || YES || The megaclass name.
|-
|-
| user_email_authenticated || timestamp with time zone || YES || [None]
| natio || character varying || YES || The natio name.
|-
|-
| user_email_token || text || YES || [None]
| no_common_name || boolean || YES || If a search has been performed for a common name and none was found, this prevents the processor from trying again.
|-
|-
| user_email_token_expires || timestamp with time zone || YES || [None]
| order || character varying || YES || The "order" name.
|-
|-
| user_id || integer || NO || [None]
| parent_taxon_id || integer || YES || The taxon ID of the taxon's parent taxon. If this column is null, the taxon has no parents.
|-
|-
| user_name || text || NO || [None]
| parvorder || character varying || YES || The parvorder name.
|-
|-
| user_newpass_time || timestamp with time zone || YES || [None]
| parvphylum || character varying || YES || The parvphylum name.
|-
|-
| user_newpassword || text || NO || [None]
| phylum || character varying || YES || The phylum name.
|-
|-
| user_password || text || NO || [None]
| phylum_division || character varying || YES || The phylum division name.
|-
|-
| user_password_expires || timestamp with time zone || YES || [None]
| rank || character varying || YES || The name of the taxonomic rank of the record, e.g., "class", "subspecies", etc.
|-
|-
| user_real_name || text || NO || [None]
| scientific_name || character varying || YES || The scientific name of the species.
|-
|-
| user_registration || timestamp with time zone || YES || [None]
| section || character varying || YES || The section name.
|-
|-
| user_token || text || NO || [None]
| series || character varying || YES || The series name.
|-
|-
| user_touched || timestamp with time zone || NO || [None]
| source || character varying || NO || The name of the source database: "inaturalist", "worms", "obis", etc.
|}
 
<span id="wiki.user_autocreate_serial"></span>
=== Table: user_autocreate_serial ===
 
None
 
{| class="wikitable"  
|+ Columns in "user_autocreate_serial"
|-
! Name !! Type !! Nullable !! Documentation
|-
| uas_shard || integer || NO || [None]
|-
|-
| uas_value || integer || NO || [None]
| species || character varying || YES || The species name.
|}
 
<span id="wiki.user_former_groups"></span>
=== Table: user_former_groups ===
 
None
 
{| class="wikitable"
|+ Columns in "user_former_groups"
|-
|-
! Name !! Type !! Nullable !! Documentation
| subclass || character varying || YES || The subclass name.
|-
|-
| ufg_group || text || NO || [None]
| subfamily || character varying || YES || The subfamily name.
|-
|-
| ufg_user || integer || NO || [None]
| subform || character varying || YES || The subform name.
|}
 
<span id="wiki.user_groups"></span>
=== Table: user_groups ===
 
None
 
{| class="wikitable"
|+ Columns in "user_groups"
|-
|-
! Name !! Type !! Nullable !! Documentation
| subgenus || character varying || YES || The subgenus name.
|-
|-
| ug_expiry || timestamp with time zone || YES || [None]
| subkingdom || character varying || YES || The subkingdom name.
|-
|-
| ug_group || text || NO || [None]
| suborder || character varying || YES || The suborder name.
|-
|-
| ug_user || integer || NO || [None]
| subphylum || character varying || YES || The subphylum name.
|}
 
<span id="wiki.user_newtalk"></span>
=== Table: user_newtalk ===
 
None
 
{| class="wikitable"
|+ Columns in "user_newtalk"
|-
|-
! Name !! Type !! Nullable !! Documentation
| subphylum_subdivision || character varying || YES || The subphylum division name.
|-
|-
| user_id || integer || NO || [None]
| subsection || character varying || YES || The subsection name.
|-
|-
| user_ip || text || NO || [None]
| subspecies || character varying || YES || The subspecies name.
|-
|-
| user_last_timestamp || timestamp with time zone || YES || [None]
| subterclass || character varying || YES || The subterclass name.
|}
 
<span id="wiki.user_properties"></span>
=== Table: user_properties ===
 
None
 
{| class="wikitable"
|+ Columns in "user_properties"
|-
|-
! Name !! Type !! Nullable !! Documentation
| subtribe || character varying || YES || The subtribe name.
|-
|-
| up_property || text || NO || [None]
| subvariety || character varying || YES || The subvariety name.
|-
|-
| up_user || integer || NO || [None]
| superclass || character varying || YES || The superclass name.
|-
|-
| up_value || text || YES || [None]
| superdomain || character varying || YES || The superdomain name.
|}
 
<span id="wiki.watchlist"></span>
=== Table: watchlist ===
 
None
 
{| class="wikitable"
|+ Columns in "watchlist"
|-
|-
! Name !! Type !! Nullable !! Documentation
| superfamily || character varying || YES || The superfamily name.
|-
|-
| wl_id || integer || NO || [None]
| superorder || character varying || YES || The superorder name.
|-
|-
| wl_namespace || integer || NO || [None]
| supertribe || character varying || YES || The supertribe name.
|-
|-
| wl_notificationtimestamp || timestamp with time zone || YES || [None]
| taxon_id || character varying || NO || The taxonomic ID from the source database.
|-
|-
| wl_title || text || NO || [None]
| tribe || character varying || YES || The tribe name.
|-
|-
| wl_user || integer || NO || [None]
| variety || character varying || YES || The variety name.
|}
|}


<span id="wiki.watchlist_expiry"></span>
=== Table: watchlist_expiry ===
None


{| class="wikitable"
<!-- END GENERATED CONTENT -->
|+ Columns in "watchlist_expiry"
|-
! Name !! Type !! Nullable !! Documentation
|-
| we_expiry || timestamp with time zone || NO || [None]
|-
| we_item || integer || NO || [None]
|}

Latest revision as of 03:34, 22 June 2025

The database is large, complex and relational with a lot of entities describing many facets of ROV operations, measurements and observations.

Notes About Specific Entities

These notes about specific entities complement the generated documentation below.

rov.dive and rov.transect

Dives represent the span of time during which an ROV, submersible or drop camera is in the water, but may also represent the time during which the instruments are operating. In cases when the instrument data are contained entirely within the time span logged by the operator, the times are recorded unchanged. When the instrument data extend beyond the recorded times of the dive, they may be extended. Occasionally, the operator will record an erroneous time, or omit a time altogether. The instrument times can help to reconstruct this history. Dives also relate to important configuration information, objectives, crew and operational notes.

Transects are defined by their start and end times, contained entirely within dives and do not cross the boundaries between dives. They do not have any related entities and function mainly as accounting items. However, they are extremely important in the analysis of observations and measurements collected during the dive. For example, if one is calculating the density of a particular population of organisms, one must know the precise geographic extent of the region. Transects accomplish this and store objectives and operational notes.

In instances where the times of transects are not recorded, or lost, they can sometimes be reconstructed from status events in the observation record (e.g., a VideoMiner database may have transect start/end events). Otherwise, they are not recorded at all. Ideally, transect records are present and their start and end times are recorded without modification, so long as they are reasonable (i.e., the end time occurs after the start time).

Generated Documentation

Database entity documentation is generated from the production database by the script, db_generate_docs.py. The script outputs a file whose contents can be copied into this page after the <!-- BEGIN GENERATED CONTENT --> tag.

The documentation is arranged into conceptual groupings with the following structure.

  • Schema
    • Table
    • Materialized View
    • View

System and Django tables aren't included. The ID column of each table is also excluded.

Database Comments

Documentation resides in the database itself, in the form of comments on the relations and columns. Documentations can be created by executing SQL statements in the form,

   COMMENT ON SHCEMA [schema] IS 'This is a schema comment.'
   COMMENT ON TABLE [schema].[table name] IS 'This is a table comment.'
   COMMENT ON COLUMN [schema].[table name].[column name] IS 'This is a column comment.'

Comments are managed using DDL, as described on the Database Upgrades page.

Generated Entity Documentation

Note: this page is auto-generated from the documentation comments in the actual database. Do not edit it directly.

Schema: intertidal

Stores data for the intertidal database. Contains information about UAS flights, surveys and other derivative data.

Table: quadrat

A record of observations within an intertidal quadrat.

Columns in "quadrat"
Name Type Nullable Documentation
centroid_height real YES The elevation of the corner position in m (ellipsoidal).
centroid_lat double precision YES The corner latitude.
centroid_lon double precision YES The corner longitude.
corner_height1 real YES The elevation of the corner position in m (ellipsoidal).
corner_height2 real YES The elevation of the corner position in m (ellipsoidal).
corner_height3 real YES The elevation of the corner position in m (ellipsoidal).
corner_height4 real YES The elevation of the corner position in m (ellipsoidal).
corner_lat1 double precision YES The corner latitude.
corner_lat2 double precision YES The corner latitude.
corner_lat3 double precision YES The corner latitude.
corner_lat4 double precision YES The corner latitude.
corner_lon1 double precision YES The corner longitude.
corner_lon2 double precision YES The corner longitude.
corner_lon3 double precision YES The corner longitude.
corner_lon4 double precision YES The corner longitude.
created_on timestamp without time zone NO created_on = models.DateTimeField(default = datetime.utcnow, null = False)
flag_number character varying NO The number of the flag used to mark the quadrat. May be non-numeric if necessary.
geom geometry YES A geometry representing either the corners of the quadrat (multipoint) or the centroid.
name character varying NO A unique name for the quadrat.
note text YES An optional note about the quadrat.
survey_id integer NO A reference to the intertidal suvey.
time timestamp without time zone NO The time of the quadrat (UTC).
transect integer NO The transect number. This is an integer corresponding to whatever rubric was chosen for the survey.
zone integer NO The zone number. This is an integer corresponding to whatever rubric was chosen for the survey.

Table: quadrat_observation

Records observations within quadrats. The observation type enumeration is defined in the database export panel.

Columns in "quadrat_observation"
Name Type Nullable Documentation
cell integer YES The quadrat cell, typically from 0 - 100.
count integer YES The number of organisms observed.
coverage real YES The percent coverage by the organism, 0-100. TODO: Not part of the specification.
length real YES The measured length of an organism.
quadrat_id integer NO A link to the quadrat.
surveytaxon_id integer NO A link to the survey taxon.
type integer YES The type of observation; one of quadrat_obs_type.

Table: quadrat_substrate

List substrates observed in intertidal quadrats.

Columns in "quadrat_substrate"
Name Type Nullable Documentation
name character varying NO The name of the substrate.

Table: quadrat_substrate_coverage

Associates quadrat substrate coverages with quadrats.

Columns in "quadrat_substrate_coverage"
Name Type Nullable Documentation
coverage real NO The coverage amount between 0% and 100%.
quadrat_id integer NO A reference to the quadrat.
substrate_id integer NO A reference to the substrate.

Table: survey

Stores metadata about intertidal surveys.

Columns in "survey"
Name Type Nullable Documentation
created_on timestamp without time zone NO The time of creation of this record.
end_date timestamp without time zone YES The end date of the survey.
name character varying NO The name of the survey.
note text YES Notes about the survey.
objective text YES The survey objective.
site_id integer YES Relates the survey to a site entity.
start_date timestamp without time zone NO The start date of the survey.

Table: survey_crew

Associates intertidal survey crew members with roles.

Columns in "survey_crew"
Name Type Nullable Documentation
note text YES An optional note about the survey role.
person_id integer NO A reference to the person with this role.
role_id integer NO A reference to the role.
survey_id integer NO A reference to the survey.

Table: survey_role

A list of roles available to intertidal survey crew members.

Columns in "survey_role"
Name Type Nullable Documentation
name character varying NO The name of the role.
note text YES A note about the role.

Table: survey_taxon

Links taxon records to intertidal surveys.

Columns in "survey_taxon"
Name Type Nullable Documentation
survey_id integer NO A link to the survey.
taxon_id integer NO A link to the taxon record.

Schema: ndst

Contains tables that store transient data loaded from the Dive Logging App so it can be loaded into the ROV database.

Table: cruise

Contains information about a cruise, as entered by NDST staff. Will be combined with other data to populate the cruise table.

Columns in "cruise"
Name Type Nullable Documentation
active boolean NO Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
created_on timestamp without time zone NO The date and time of creation of the entity.
hide integer NO True if the entity should be hidden in the UI.
leg text YES The leg of the cruise. Should start at 1 and increase.
name text YES The name of the cruise.
note text YES The objective of the cruise.
objective text YES [None]
row_id text YES A UUID providing a universally-unique identifier for the cruise.
status character varying YES The current status of the cruise viz. database import.
summary text YES A summary of the cruise, its accomplishments, problems, etc.
updated_on timestamp without time zone NO The date and time of the entity's last update.

Table: diveconfig

Stores configurations for each dive, including the submersible, ship and any instruments on either.

Columns in "diveconfig"
Name Type Nullable Documentation
active boolean NO Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
created_on timestamp without time zone NO The date and time of creation of the entity.
name text YES The name of the dive config.
note text YES A note about the dive config.
row_id text YES A UUID providing a universally-unique identifier for the entity.
ship_config text YES Stores the name of the ship configuration during the dive.
ship_instrument_configs text YES Stores the names of the instruments on the ship during the dive.
sub_config text YES Stores the name of the submersible configuration during the dive.
sub_instrument_configs text YES Stores the names of the instruments on the sub during the dive.
updated_on timestamp without time zone NO The date and time of the entity's last update.

Table: dives

Stores information about each dive.

Columns in "dives"
Name Type Nullable Documentation
active boolean NO Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
created_on timestamp without time zone NO The date and time of creation of the entity.
cruise_name text YES The name of the cruise.
dive_config text YES The name of the dive configuration.
end_time text YES The time of dive ending.
hide integer NO True if the entity should be hidden in the UI.
leg text YES The leg of the cruise.
name text YES The name of the dive.
note text YES A note about the dive.
objective text YES The objective of the dive.
pilot text YES The pilot(s) of the dive.
row_id text YES A UUID providing a universally-unique identifier for the entity.
site_name text YES The name of the dive site.
start_time text YES The time of dive start.
summary text YES A summary of the dive, its accomplishments, problems, etc.
updated_on timestamp without time zone NO The date and time of the entity's last update.

Table: equipconfig

Stores configurations for equipment, including instruments and platforms.

Columns in "equipconfig"
Name Type Nullable Documentation
active boolean NO Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
configuration text YES A JSON object containing configuration properties.
created_on timestamp without time zone NO The date and time of creation of the entity.
name text YES The name of the equipment config.
note text YES A note about the equipment config.
row_id text YES A UUID providing a universally-unique identifier for the entity.
short_code text YES A short, easy-to-use identifier for the configuration.
type text YES The type of equipment.
updated_on timestamp without time zone NO The date and time of the entity's last update.

Table: equipment

Stores equipment, including instruments and platforms.

Columns in "equipment"
Name Type Nullable Documentation
active boolean NO Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
brand text YES The brand name of the equipment.
created_on timestamp without time zone NO The date and time of creation of the entity.
instrument_id integer YES The ID of the instrument in the ROV database. Mutually exclusive with platform_id.
model text YES The model name of the equipment.
note text YES A note about the equipment.
platform_id integer YES The ID of the platform in the ROV database. Mutually exclusive with instrument_id.
row_id text YES A UUID providing a universally-unique identifier for the entity.
serial_number text YES The serial number.
short_code text YES The short code for the equipment as used in the ROV database equipment table.
short_code_mapped character varying YES An optional mapping from the origin short code to an internal short code. Not unique because multiple source items can map to a single internal item.
type text YES The type of equipment.
updated_on timestamp without time zone NO The date and time of the entity's last update.

Table: people

Stores the people who worked on the cruise.

Columns in "people"
Name Type Nullable Documentation
active boolean NO Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
created_on timestamp without time zone NO The date and time of creation of the entity.
email text YES The email address.
first_name text YES The first name.
initials text YES The initials. Used like a short code for the person.
last_name text YES The last name.
person_id integer YES The ID of the person in the ROV database.
row_id text YES A UUID providing a universally-unique identifier for the entity.
updated_on timestamp without time zone NO The date and time of the entity's last update.

Table: transects

Stores information about each transect.

Columns in "transects"
Name Type Nullable Documentation
active boolean NO Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
created_on timestamp without time zone NO The date and time of creation of the entity.
cruise_name text YES The name of the cruise.
dive_name text YES The name of the dive.
end_time text YES The time of transect ending.
hide integer NO True if the entity should be hidden in the UI.
leg text YES The leg of the cruise.
name text YES The name of the transect.
note text YES A note about the transect.
objective text YES The objective of the transect.
row_id text YES A UUID providing a universally-unique identifier for the entity.
start_time text YES The time of transect start.
summary text YES A summary of the transect, its accomplishments, problems, etc.
updated_on timestamp without time zone NO The date and time of the entity's last update.

Schema: rov

The main schema of the ROV database, stores information about all relevant entities including cruise metadata, personnel, dives, transects, equipment configuration, telemetry, water properties and observations.

Table: abundance

Stores a list of abundance labels from the ACFOR scale.

Columns in "abundance"
Name Type Nullable Documentation
name character varying NO A descriptive label for the abundance level.
note text YES An optional note about the abundance level.
rank integer YES A rank used to objectively interpret the abundance label as an ordinal rank. It doesn't matter what the values are so long as they increase monotonically and do not overlap.
short_code character varying YES Contains a short code that can be used to look up an abundance (e.g., during import) without relying on the primary key.
source character varying NO A source label to distinguish abundance labels with the same names. TODO: Provisional, pending determination of how abundance codes are handled.

Table: annotation_job

Stores information about the annotation projects that generate information from photo and video media.

Columns in "annotation_job"
Name Type Nullable Documentation
created_on timestamp without time zone YES The date of creation of the entity.
end_date date YES The ending date of the project.
name character varying NO A name for the annotation project.
note text YES Operational notes about the annotation project.
objective text YES A statement of the objectives of the annotation project.
start_date date YES The starting date of the project.
updated_on timestamp without time zone YES The date of last modification of the entity.

Table: annotation_job_annotation_protocol

Associates the annotation job with one or more annotation protocols, which are used to direct annotation activities.

Columns in "annotation_job_annotation_protocol"
Name Type Nullable Documentation
annotation_job_id integer NO The ID of the annotation job.
annotation_protocol_id integer NO The ID of the annotation protocol.

Table: annotation_job_crew

Associates crew members with an annotation job with their respective roles.

Columns in "annotation_job_crew"
Name Type Nullable Documentation
annotation_job_id integer NO The ID of the annotation job.
person_id integer NO The ID of the crew member.
role_id integer NO The ID of the role.

Table: annotation_job_role

Stores the possible roles one can perform on an annotation job.

Columns in "annotation_job_role"
Name Type Nullable Documentation
name character varying NO The name of the role.
note text YES A descript of the role.

Table: annotation_protocol

A table to record annotation protocols for annotation projects. Stores information such as the author of the protocol, the observation interval, the medium used and the types of observations to be made.

Columns in "annotation_protocol"
Name Type Nullable Documentation
algae_species character varying YES Whether all algae species are identified: "all", "subset" or "none".
annotation_software_id integer NO Software used to annotate the video or images. Looked up in the annotation software table.
biogenic_habitat boolean YES True if any habitat categories include fauna (e.g., sponge reefs).
created_on timestamp without time zone NO The date of creation of this record.
creator_id integer YES Records the identity of the person who created this protocol.
fish_species character varying YES Whether all fish species are identified: "all", "subset" or "none".
fov_interval real YES The time interval between field-of-view measurements.
fov_interval_unit character varying NO A unit for the field of view interval, such as 's' for seconds or 'm' for metres.
habitat_interval real YES The time interval between habitat observations.
habitat_interval_unit character varying NO A unit for the habitat interval, such as 's' for seconds or 'm' for metres.
habitat_only boolean YES Set to true if only habitat variables were recorded.
image_interval real YES The interval between images or frame grabs. Typically 3 to 10 seconds.
image_interval_unit character varying NO A unit for the image interval, such as 's' for seconds or 'm' for metres.
image_overlap boolean YES Is there overlap between the images (true) or do they represent independent non-overlapping space (false).
invertebrate_species character varying YES Whether all invertebrate species are identified: "all", "subset" or "none".
is_template boolean YES If this is meant to be a template that is copied for use, mark this column `true`.
medium_type_id integer NO The type of media used for annotation. Looked up in media type table.
name character varying NO The name of the annotation protocol. Should be unique.
note text YES If only a subset of invert, fish or algae species were identified, note here which groups were the primary focus (target species). For example, benthic fish or corals and sponges. Also for other notes of interest.
observation_interval real YES The time interval between species or anthropogenic observations.
observation_interval_unit character varying NO A unit for the observation interval, such as 's' for seconds or 'm' for metres.
protocol_document character varying YES Link, title, DOI, etc. of a document describing the protocol in full.
species_guide character varying YES A URL to the iNaturalist species guide that was used for annotation.
updated_on timestamp without time zone NO The date of update of this record.

Table: annotation_protocol_document

Contains documents related to an annotation protocol. These can be a URL or actual file data. If the file data are present in the database, the URL can still be used to provide the origin of the file, etc.

Columns in "annotation_protocol_document"
Name Type Nullable Documentation
annotation_protocol_id integer NO A reference to the annotation protocol.
created_on timestamp without time zone NO The time of creation of the record.
file_id integer YES A reference to the uploaded file.
note text YES An optional note about the document.
title character varying NO The title of the document.
updated_on timestamp without time zone NO The time of update of the record.
url character varying YES An optional URL for the document. If file data are not given, this field is required.

Table: annotation_software

The software used for annotation.

Columns in "annotation_software"
Name Type Nullable Documentation
name character varying NO The name of the annotation software.
note text YES An optional note about the annotation software.

Table: biigle_label_map

Contains mappings from Biigle labels to properties that apply to events.

Columns in "biigle_label_map"
Name Type Nullable Documentation
created_on timestamp without time zone NO The time of creation of the record.
label_hierarchy text NO The full hierarchical text of the Biigle label.
label_id integer NO The ID of the Biigle label.
label_text text NO The text of the final element of the label.
label_tree_id integer NO The ID of the Biigle label tree.
note text YES A textual note or comment.
properties jsonb NO Stores the properties of the observation.
updated_on timestamp without time zone NO Time of last update of the record.

Table: biigle_label_map_restriction

Links a Biigle label map to a [restriction][#shared.restriction].

Columns in "biigle_label_map_restriction"
Name Type Nullable Documentation
biigle_label_map_id integer NO A link to the label map.
restriction_id integer NO A link to the restriction.

Table: biocover

A lookup table listing the available biocover types for the habitat_event table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity. TODO: Should perhaps refer to the taxon table.

Columns in "biocover"
Name Type Nullable Documentation
name character varying NO The name of the biocover.
note text YES An optional description of the biocover.
short_code character varying YES Contains a short code that can be used to look up a biocover (e.g., during import) without relying on the primary key.

Table: complexity

A lookup table listing the available habitat complexity types for the habitat_event table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.

Columns in "complexity"
Name Type Nullable Documentation
name character varying NO The name of the complexity type.
note text YES An optional description of the complexity type.
short_code character varying YES Contains a short code that can be used to look up a complexity (e.g., during import) without relying on the primary key.

Table: coverage

A lookup table listing the percentage of coverage for the habitat_event table. The coverages are given as ranges so the text of the level is given in the name field and the values in the min and max fields contain the bounding values.

Columns in "coverage"
Name Type Nullable Documentation
maximum real NO The minimum value in the range.
minimum real NO The minimum value in the range.
name character varying NO A characterization of percent coverage. Presented as a range of percentages.
note text YES An optional note about the coverage percentage.
short_code character varying YES Contains a short code that can be used to look up a coverage (e.g., during import) without relying on the primary key.

Table: cruise

Cruise legs occur within a cruise and are assigned specific crews, scientific programs, etc. A single leg can cover an entire cruise, legs can be spaced end-to-end, or can theoretically overlap. Legs can share members or equipment, and crew members can have specific roles related to a leg. Cruise legs can be created without a scientific program or a cruise because imported data sets may only list the name of the cruise and not indicate whether it was part of a longer cruise.

Columns in "cruise"
Name Type Nullable Documentation
admin_note text YES Notes by the database administrator about this entity.
approved integer NO If zero, the record is not approved and should not be shown or used. Currently a non-zero value represents approval, but may be expanded to various levels of approval in the future.
created_on timestamp without time zone NO The date of creation of this record.
end_time timestamp without time zone YES The end time of the leg.
leg integer NO Cruise legs are numbered from 1.
mark_for_delete boolean NO Marks the entity for asynchronous deletion by the runner.
name character varying NO A name for this leg of the cruise.
note text YES Notes about the cruise.
objective text YES A statement of the operational or scientific objectives of the cruise.
planned_track USER-DEFINED YES A multilinestring containing the planned track of the leg. TODO: Not known whether this is necessary.
ship_id integer NO The ID of the ship used on this cruise.
start_time timestamp without time zone NO The start time of the leg.
summary text YES A summary of the cruise, with information about whether the objectives were met and any other pertinent information.
updated_on timestamp without time zone NO The date of update of this record.

Table: cruise_crew

Associates crew members with a cruise leg and their roles. A crew member can have multiple roles. Note: these roles are distinct from members of programs, such as Chief Scientist. It may be necessary to revisit this structure or the division of roles.

Columns in "cruise_crew"
Name Type Nullable Documentation
cruise_id integer NO Reference to the cruise leg to which the member is assigned.
cruise_role_id integer NO Reference to the cruise role.
note text YES An optional note about the crew member.
person_id integer NO Reference to the person on the crew.

Table: cruise_document

Stores information about documents related to a cruise.

Columns in "cruise_document"
Name Type Nullable Documentation
created_on timestamp without time zone NO The date and time of creation of the entity.
cruise_id integer NO The ID of the cruise.
file_id integer YES [None]
note text YES A note about the document.
title character varying NO The title of the document.
updated_on timestamp without time zone NO The date and time of the entity's last update.
url character varying YES A URL for the online copy of the document. May be used when no file is available.

Table: cruise_fn_contact

A table for associating First Nations contacts with a cruise.

Columns in "cruise_fn_contact"
Name Type Nullable Documentation
contact_name character varying NO The full name of the contact.
cruise_id integer NO A reference to the cruise.
email character varying YES The email address of the contact.
nation text YES The name of the nation or group represented by the contact.
note text YES A note about the contact.
phone character varying YES The phone number of the contact.

Table: cruise_import

Stores cruise import tasks in the database. These contain the JSON data description, a status message and complete processing log.

Columns in "cruise_import"
Name Type Nullable Documentation
created_on timestamp without time zone YES [None]
data jsonb NO A JSON document containing the cruise import data.
logs jsonb NO A JSON array containing the complete processing log.
name character varying NO A unique name for the import job.
status character varying NO A status message about processing.
updated_on timestamp without time zone YES [None]
version integer NO [None]

Table: cruise_library

This table creates an association between a cruise leg and documents in the library that may be relevant to its research objectives.

Columns in "cruise_library"
Name Type Nullable Documentation
cruiseleg_id integer NO A reference to the cruise leg.
library_id integer NO A reference to the document in the library.
note text YES An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc.

Table: cruise_program

A table to link programs and cruises. A cruise can be under the auspices of more than one program or none.

Columns in "cruise_program"
Name Type Nullable Documentation
cruise_id integer NO The ID of a cruise.
program_id integer NO The ID of a program.

Table: cruise_role

A lookup table of roles available to members of cruise leg crews.

Columns in "cruise_role"
Name Type Nullable Documentation
name character varying NO The name of the role.
note text YES An optional note about the role and its responsibilities.
short_code character varying YES A short string used to identify the role.

Table: disturbance

Provides a nominal level of disturbance for habitat events.

Columns in "disturbance"
Name Type Nullable Documentation
name character varying NO The textual representation of the disturbance level.
note text YES A note about the disturbance level.
short_code character varying YES Contains a short code that can be used to look up a disturbance (e.g., during import) without relying on the primary key.

Table: dive

A dive is what an ROV does. The dive has a start and end time (not necessarily submerge/resurface), a crew and possibly a name. Transects occur during dives.

Columns in "dive"
Name Type Nullable Documentation
admin_note text YES [None]
attributes jsonb YES A JSON column used for recording structured attributes that do not fit with the regular table structure.
created_on timestamp without time zone NO The date of creation of this record.
cruise_id integer NO A reference to the cruise leg during which the dive was performed.
end_time timestamp without time zone NO The end of the dive.
mark_for_delete boolean NO Marks the entity for asynchronous deletion by the runner.
name character varying NO A name for the dive.
note text YES An optional note about the dive.
objective text YES A statement of the practical or research objectives for this dive.
seatube_id integer YES The ID of a dive on SeaTube corresponding to this dive.
ship_config_id integer NO A reference to the platform config for the ship.
site character varying YES An optional name for the site.
start_time timestamp without time zone NO The start of the dive. Not necessarily the time the vehicle is placed in the water.
sub_config_id integer NO A reference to the platform config for the submersible or ROV.
summary text YES A summary of the dive; whether objectives were met, problems encountered, etc.
updated_on timestamp without time zone NO The date of update of this record.

Table: dive_crew

Assigns roles to dive crew members. Crew members are selected from the person.

Columns in "dive_crew"
Name Type Nullable Documentation
dive_id integer NO The dive to which the crew member is assigned.
dive_role_id integer NO A reference to the dive role.
note text YES An optional note about the crew member.
person_id integer NO A reference to the person.

Table: dive_role

A list of roles available to crew members on a dive via the dive_crew table.

Columns in "dive_role"
Name Type Nullable Documentation
name character varying NO The name of the role.
note text YES An optional description of the role.
short_code character varying YES A short string used to identify the role.

Table: equipment_type

This is a lookup table to provide the names of types of equipment for the model_equipment_type table, e.g., "Digital Still Camera", "Thermometer," "ROV," etc.

Columns in "equipment_type"
Name Type Nullable Documentation
category USER-DEFINED YES An enumeration column identifying the equipment as platform, instrument or some other type.
name character varying NO A name for the equipment type.
note text YES An optional note about the equipment type.

Table: event

The event table, a schemaless table storing all recorded observations and statuses during operations.

Columns in "event"
Name Type Nullable Documentation
annotation_job_id integer YES [None]
created_on timestamp without time zone NO The time of creation of the event.
dive_id integer NO A reference to the dive during which this event occurred.
end_time timestamp without time zone YES The end time of the event. Null, if the event is discrete.
hidden boolean NO If true, the entity should be hidden from searches and reports. An alternative to deleting entities that may prove useful in the future.
instrument_config_id integer YES [None]
note text YES An optional note about the event. Do not use to store event data.
properties jsonb NO A JSON object containing name-value pairs describing the event.
restriction_mask bit NO [None]
start_time timestamp without time zone NO The start time of the event.
updated_on timestamp without time zone NO The time of update of the event. Automatically updated by a trigger.

Table: event_logger

This table tracks the people who contributed to annotation, which may be composed of a number of separate labels.

Columns in "event_logger"
Name Type Nullable Documentation
event_id integer NO The event that was created from the annotation(s).
person_id integer NO A person who contributed to the annotation.

Table: flow

Stores categories of current flow for habitat.

Columns in "flow"
Name Type Nullable Documentation
name character varying NO A note about the flow category.
note text YES [None]
short_code character varying YES A short code for the flow category.

Table: generic_label_map

A table for storing mappings from annotation labels to property sets.

Columns in "generic_label_map"
Name Type Nullable Documentation
created_on timestamp without time zone NO The date of creation.
label_text USER-DEFINED NO The text of the label.
note text YES A note about the mapping.
properties jsonb NO A dictionary of mapped properties.
updated_on timestamp without time zone NO The date of last update.

Table: generic_label_map_restriction

Links a generic label mapping to a restriction.

Columns in "generic_label_map_restriction"
Name Type Nullable Documentation
generic_label_map_id integer NO A reference to a generic label mapping.
restriction_id integer NO A reference to a restriction.

Table: image_quality

Nominal image quality levels, originally used by VideoMiner but applicable to new records.

Columns in "image_quality"
Name Type Nullable Documentation
name character varying NO A name for the quality level.
note text YES An optional note.
rank integer YES An ordinal rank (zero is high) for the quality level.
short_code character varying YES Contains a short code that can be used to look up an image quality (e.g., during import) without relying on the primary key.

Table: import_queue_annotator

Stores the import packages created by annotators. Some fields are transferred to the annotation job to record the objectives of the project. Each queue item (and therefore each job) should correspond to a single annotation project, and not encompass multiple projects with different objectives.

Columns in "import_queue_annotator"
Name Type Nullable Documentation
created_on timestamp without time zone NO The date of creation of the record.
cruise_name character varying NO The name of the cruise to which this record is linked. A lookup is not used because the cruise record may not have been created yet.
data jsonb NO Stores the JSON representation of the import job.
end_date date YES [None]
hidden boolean NO [None]
name character varying NO A unique name for the import queue record.
note text YES An optional note about the import package.
objective text YES [None]
start_date date YES [None]
status character varying YES A short description of the processing status of the job.
updated_on timestamp without time zone NO The date of update of the record.
user_id integer NO A reference to the MSEA user that created the record.

Table: import_queue_annotator_label_map_prefill

A table to store the last configured tags and values for labels. Provides pre-filling in label mapping application.

Columns in "import_queue_annotator_label_map_prefill"
Name Type Nullable Documentation
created_on timestamp without time zone YES The date and time of creation of the entity.
event_type jsonb YES [None]
label_tree_name character varying YES The label tree name. If given identifies the label uniquely with the tree name.
name character varying NO The text of the label.
properties jsonb NO The the tag data.
tags jsonb NO The list of tags.
updated_on timestamp without time zone YES The date and time of the entity's last update.

Table: import_queue_pi

Stores the import packages created by principal investigators.

Columns in "import_queue_pi"
Name Type Nullable Documentation
created_on timestamp without time zone NO The date of creation of the record.
cruise_id integer NO A reference to the cruise.
hidden boolean NO [None]
name character varying NO A name of the import job
note text YES An optional note about the import package.
status character varying YES A short description of the processing status of the job.
updated_on timestamp without time zone NO The date of update of the record.
user_id integer NO A reference to the MSEA user that created the record.

Table: instrument

This table represents instruments, which are concrete instances of the types represented in the model table. instruments tend to be things that generate data, be it a thermometer or a camera. For the purposes of this database, an instrument is anything that is not a platform.

Columns in "instrument"
Name Type Nullable Documentation
attributes jsonb YES A freeform list of attributes for this instrument.
created_on timestamp without time zone NO The date of creation of this record.
model_id integer NO A reference to the instrument model.
name character varying YES A name for the instrument to distinguish it from others of the same model.
note text YES An optional note about this instrument.
organisation_id integer NO A reference to the organisation that owns and operates the instrument.
retired date YES If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active.
serial_number character varying NO The serial number of the instrument. If a serial number is not available, some unique identifier can be substituted. No two instruments of the same model may have the same serial number.
updated_on timestamp without time zone NO The date of update of this record.

Table: instrument_config

This table records the configuration of an instrument, including settings and its spatial relationship to a parent entity -- another configured vehicle or instrument upon which this instrument is mounted.

Columns in "instrument_config"
Name Type Nullable Documentation
configuration jsonb YES Configuration information about the instrument config.
created_on timestamp without time zone NO The date of creation of this record.
instrument_id integer NO Reference to the instrument targeted by the configuration.
mark_for_delete boolean NO Marks the entity for asynchronous deletion by the runner.
note text YES An optional note about this configuration.
platform_config_id integer YES The ID of the platform upon which the instrument is used.
updated_on timestamp without time zone NO The date of update of this record.

Table: measurement

This table preserves time-stamped measurements generated by instruments. Each measurement has an associated quantity and unit. TODO: At this point multi-part measurement would be stored separately as the ability to store vectors isn't universal across DBMSes.

Columns in "measurement"
Name Type Nullable Documentation
instrument_config_id integer NO The configured instrument used to generate this item.
is_modelled boolean NO A flag to indicate whether the value is derived from measurements by some modelling process.
measurement_type_id integer NO A reference to the type of this measurement.
quantity real NO The scalar quantity or magnitude of the measurement.
signal_quality real YES A quality of the measurement as reported by the instrument. TODO: Requires clarification.
timestamp timestamp without time zone NO The time that the measurement was recorded.

Table: measurement_type

This is a lookup table of types of measurement types for the measurement or measurement_event tables. This is fairly open-ended and can represent something like salinity with a specific unit, be it the SI unit or a discipline-specific unit. It is provided to allow users to easily select units for a measurement category when importing data.

Columns in "measurement_type"
Name Type Nullable Documentation
maximum real YES An optional upper bound on the value of the measurement. Null implies no limit.
minimum real YES An optional lower bound on the value of the measurement. Null implies no limit.
name character varying NO The type of measurement. E.g., "Density" or "Salinity."
note text YES An optional note about this measurement type.
short_code character varying YES Contains a short code that can be used to look up a measurement type (e.g., during import) without relying on the primary key.
unit character varying NO The unit. SI units are preferred but not required. The unit selection should probably depend on field-specific idiomatic or cultural preferences.

Table: medium_format

A lookup table for data formats for the medium table. This will include things like video, photo and acoustic. TODO: To be determined whether medium formats should be discriminated more granularly than this. TODO: Should maybe be categorised into video/photo/acoustic/etc. along with things like the format (JPG, MP4, AAC) and possibly more specific encoding parameters.

Columns in "medium_format"
Name Type Nullable Documentation
extensions jsonb NO A list of file extensions that correspond to this medium type. For example, the JPEG image type may have extensions "jpg" or "jpeg" in any case. This list will help applications guess the correct format of a file if it isn't known. Note that more than one media type can have the same extension, so this feature doesn't provide a guaranteed one-to-one mapping. Use it only as a guide.
medium_type_id integer NO A reference to the medium type (e.g., video or photo).
name character varying NO The name of the format.
note text YES An optional note about the format.
short_code character varying YES Contains a short code that can be used to look up a medium format (e.g., during import) without relying on the primary key.

Table: medium_type

A simple lookup to provide media types to the annotation_protocol table. These are not specific media formats (as stored in medium_format), but provided a higher-level distinction.

Columns in "medium_type"
Name Type Nullable Documentation
name character varying NO The name of the media type.
note text YES An optional note about the media type.
short_code character YES Provides a short code for looking up the entity.

Table: model

This table records the brand and model of equipment in the inventory. This data is abstract, which is to say, there is only one record for "GoPro Hero4" but there will be one record for each concrete instance of the model in the instrument table. The model table stores both instruments and platforms.

Columns in "model"
Name Type Nullable Documentation
attributes jsonb YES A free-form JSON field for attributes of this model.
brand_name character varying NO The brand name.
equipment_type_id integer NO A reference to the equipment type.
model_name character varying NO The model name.
note text YES An optional note about the model.

Table: model_documentation

This table creates an association between a model and documentation in the library.

Columns in "model_documentation"
Name Type Nullable Documentation
library_id integer NO A reference to the document in the library.
model_id integer NO A reference to the model.
note text YES An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc.

Table: model_equipment_type

This table associates an equipment model with the abstract type of equipment it represents. For example, a GoPro Hero4 is both a digital video camera and a digital still camera. These values are taken from the equipment_type table.

Columns in "model_equipment_type"
Name Type Nullable Documentation
equipment_type_id integer NO The equipment type ID.
model_id integer NO A reference to the model.

Table: observation_confidence

Provides a nominal observation confidence level for observation events.

Columns in "observation_confidence"
Name Type Nullable Documentation
name character varying NO The textual representation of the confidence level.
note text YES A note about the confidence level.
rank integer NO This field is a way of ranking confidence levels so that an ordering can be established.
short_code character varying YES Contains a short code that can be used to look up a observation confidence (e.g., during import) without relying on the primary key.

Table: orientation

This table preserves time-stamped orientation measurements from instruments. These are interpreted according to a specified type. Ship and ROV orientation will be recorded here, though ships don't ordinarily have an orientation.

Columns in "orientation"
Name Type Nullable Documentation
instrument_config_id integer NO The configured instrument used to generate this item.
is_modelled boolean NO A flag to indicate whether the value is derived from measurements by some modelling process.
orientation jsonb NO The orientation vector.
orientation_type_id integer NO A reference to the orientation type of this orientation.
signal_quality real YES The signal quality of the position as reported by the instrument. TODO: Requires clarification.
timestamp timestamp without time zone NO The time the position was recorded.

Table: orientation_type

These entities describe the interpretation of the orientation vector in the instrument_config and orientation tables. This can be a 3- or 4-element vector representing yaw, pitch roll; Tait-Bryan angles; Euler angles or a Quaternion.

Columns in "orientation_type"
Name Type Nullable Documentation
name character varying NO The name of the orientation type (e.g., "Quaternion").
note text YES An optional note about the orientation type.
short_code character varying YES Contains a short code that can be used to look up an orientation type (e.g., during import) without relying on the primary key.
unit character varying NO The units used to interpret the elements of the vector.

Table: platform

This table maintains the inventory of vehicles, that is, ships and ROVs.

Columns in "platform"
Name Type Nullable Documentation
attributes jsonb YES A freeform list of attributes for this platform.
created_on timestamp without time zone NO The date of creation of this record.
model_id integer NO A reference to the model of the platform.
name character varying NO The name of the platform. If this is a ship, it might be "CCGS Vector" or if it's an ROV, it might be given an arbitrary name by the maintainer.
note text YES An optional note about this platform.
organisation_id integer NO A reference to the organisation that owns and operates the platform.
retired date YES If the platform is retired, this records the date. If null, the platform is assumed to be active.
serial_number character varying YES The serial number of the platform. If this is an ROV it will be the manufacturer's serial number. If it's a vessel, this might be the IMO number. In any case, it must be unique.
short_code character YES Contains a short code that can be used to look up a platform (e.g., during import) without relying on the primary key.
updated_on timestamp without time zone NO The date of update of this record.

Table: platform_config

This table stores configuration information about vehicles (ships, ROVs,etc.) used for surveys. All references to vehicles are made through this table rather than directly to the platform table, because the disposition of equipment on the platform is essential to understanding how data has been generated, as well as for simple record-keeping purposes.

Columns in "platform_config"
Name Type Nullable Documentation
configuration jsonb YES The configuration data as a JSON object.
created_on timestamp without time zone NO The date of creation of this record.
mark_for_delete boolean NO Marks the entity for asynchronous deletion by the runner.
note text YES An optional note about the configuration record.
platform_id integer NO A reference to the platform.
updated_on timestamp without time zone NO The date of update of this record.

Table: position

This table preserves time-stamped position measurements from instruments. These can be linear (e.g., UTM) or angular (e.g., Geographic) positions in a specified unit. Ship and ROV positions will be recorded here. TODO: Should this table have a spatial object (point) as well, or be split into two tables, one for absolute georeferenced positions and one for relative positions and orientations?

Columns in "position"
Name Type Nullable Documentation
geom geometry YES The point geometry.
instrument_config_id integer NO The configured instrument used to generate this item.
is_modelled boolean NO A flag to indicate whether the value is derived from measurements by some modelling process.
position_type_id integer NO A reference to the position type of this position.
signal_quality real YES The signal quality of the position as reported by the instrument. TODO: Requires clarification.
timestamp timestamp without time zone NO The time the position was recorded.

Table: position_type

Describes the interpretation of a coordinate vector in the position table. These can be geographic or Cartesian positions or orientations and have defined linear or angular units.

Columns in "position_type"
Name Type Nullable Documentation
name character varying NO The name of the position type. E.g., "Geographic" or "Yaw, Pitch, Roll."
note text YES An optional note about this position type.
short_code character varying YES Contains a short code that can be used to look up a position type (e.g., during import) without relying on the primary key.
unit character varying NO The unit. Linear or angular. E.g., "m" or "radians."

Table: program

This is a listing of scientific programs that can be associated with cruise legs, and gives information about the governorship and funding of specific research activities. Label trees and taxonomies may be associated with programs, since some trees are relevant to specific research objectives and not others. TODO: Currently a lable tree/taxonomy can only be linked to one program. Need to study further.

Columns in "program"
Name Type Nullable Documentation
created_on timestamp without time zone NO The date of creation of this item.
end_date date YES The optional end date of the program.
name character varying NO The name of the program.
note text YES An optional note about the program.
objective character varying YES The objective or mandate of the program.
start_date date NO The starting date of the program.
summary text YES A summary of the program; whether objectives were met, problems encountered, etc.
updated_on timestamp without time zone NO The date of update of this record.

Table: program_library

A table to associate programs with library documents.

Columns in "program_library"
Name Type Nullable Documentation
library_id integer NO A reference to the library item.
program_id integer NO A reference to the program item.

Table: program_member

Assigns user roles to a program.

Columns in "program_member"
Name Type Nullable Documentation
person_id integer NO A reference to the person.
program_id integer NO The reference to the program.
role_id integer NO A reference to the program role.

Table: program_role

Represents the roles a person might perform in respect to a program. A person can be assigned multiple roles within a single program, and multiple people can work on a program with the same role.

Columns in "program_role"
Name Type Nullable Documentation
name character varying NO The name of the role. E.g., "Chief Scientist."
note text YES An optional note about the role.

Table: protocol

This table stores "(survey) protocol" entries from the source data. TODO: Used by events though it's not yet clear if it should stay this way.

Columns in "protocol"
Name Type Nullable Documentation
name character varying NO A name for the survey protocol.
note text YES An optional note about the protocol.
short_code character varying YES Contains a short code that can be used to look up a survey protocol (e.g., during import) without relying on the primary key.

Table: relief

Provides a nominal level of terrain relief for habitat events.

Columns in "relief"
Name Type Nullable Documentation
name character varying NO The textual representation of the relief level.
note text YES A note about the relief level.
short_code character varying YES Contains a short code that can be used to look up a relief (e.g., during import) without relying on the primary key.

Table: signup_area

Stores the region within which sign-ups are permitted, generally North America.

Columns in "signup_area"
Name Type Nullable Documentation
geom geometry YES The geometry of the sign-up region.
name character varying NO The name of the sign-up region.

Table: status_type

This is a lookup table for available status types, such as "on bottom" or "off bottom." These are specialized in the status_type_detail table where a note distinguishes different flavours of a given type. For example, there can be multiple types of "Off Transect" events with a different explanation for each.

Columns in "status_type"
Name Type Nullable Documentation
name character varying NO The name of the status event.
note text YES An optional description of the status type.
short_code character YES A short code for referencing the status type in import documents.

Table: status_type_detail

This table associates a status type with a status event. The point of this indirection is to allow the addition of detail relative to the status type. For example, there are multiple reasons why an ROV might be "off transect", including that the vehicle has experienced a failure, or the pilot is investigating some interesting object with no research value. The status type value is the discriminator for the event, but the detail adds context the doesn't interfere with it.

Columns in "status_type_detail"
Name Type Nullable Documentation
name character varying NO The status type detail. This field distinguishes different uses for status types. For example, there can be more than one reason to record an "Off Transect" event.
note text YES Optional extended description of detail.
short_code character YES Contains a short code that can be used to look up a status type detail (e.g., during import) without relying on the primary key.
status_type_id integer NO A reference to the status type.

Table: substrate

A lookup table listing the available substrate types for the habitat_event table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.

Columns in "substrate"
Name Type Nullable Documentation
name character varying NO The name of the substrate.
note text YES An optional description of the substrate.
short_code character varying YES Contains a short code that can be used to look up a substrate (e.g., during import) without relying on the primary key.

Table: survey_mode

This table stores "survey mode" entries from the source data. TODO: Used by events though it's not yet clear if it should stay this way.

Columns in "survey_mode"
Name Type Nullable Documentation
name character varying NO The name of the survey mode.
note text YES An optional note about the survey mode.
short_code character varying YES Contains a short code that can be used to look up a survey mode (e.g., during import) without relying on the primary key.

Table: thickness

A lookup table listing the available substrate thicknesses for the habitat_event table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.

Columns in "thickness"
Name Type Nullable Documentation
maximum real YES The maximum value in the range.
minimum real YES The minimum value in the range.
name character varying NO A characterization of biocover thickness.
note text YES An optional note about the biocover thickness.
short_code character varying YES Contains a short code that can be used to look up a thickness (e.g., during import) without relying on the primary key.

Table: transect

A transect is a section of a dive during which interesting data are collected. Every transect is associated with a dive.

Columns in "transect"
Name Type Nullable Documentation
admin_note text YES [None]
attributes jsonb YES A JSON column used for recording structured attributes that do not fit with the regular table structure.
dive_id integer NO A reference to the dive during which this transect occurred.
end_time timestamp without time zone YES The end time of the transect.
name character varying NO The name of the transect.
note text YES An optional note about the transect.
objective text YES A statement of the practical or research objectives for this true.
start_time timestamp without time zone NO The start time of the transect.
summary text YES A summary of the transect; whether objectives were met, problems encountered, etc.

Table: weather_observation

Surface weather observations can be recorded by any crew member aboard a ship during a cruise leg.

Columns in "weather_observation"
Name Type Nullable Documentation
cruise_crew_id integer YES A reference to the cruise leg crew member who is making the report.
cruise_id integer NO A link to the cruise during which this record was recorded.
note text YES An optional note about the observation
pressure real YES The air pressure.
swell character varying YES Description of swell.
temperature real YES The air temperature.
time timestamp without time zone NO An optional note about the weather.
wind_direction real YES The wind direction.
wind_speed real YES The wind speed.

Schema: shared

Stores data that are shared between other schemas, such as personnel information, taxonomy, etc.

Table: db_version

Stores the current database version so that upgrade scripts can perform migrations appropriately.

Columns in "db_version"
Name Type Nullable Documentation
revision integer NO The revision number.
updated_on timestamp without time zone NO The time the upgrade was performed.
version_major integer NO The major version.
version_minor integer NO The minor version number.

Table: file

Stores a record of a file object and its location on disk, along with some metadata. This entity is used by all other entities in all schemas that refer to a file object. This should make it easier to audit file stores and e.g., find duplicates using the hash.

Columns in "file"
Name Type Nullable Documentation
blob_url character varying YES A URL referencing the file in online blob storage. This field is subject to change depending on where the files reside and will change if they're moved.
created_on timestamp without time zone NO The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
description text YES An optional description for the file.
file_type_id integer YES An optional reference to the file type.
hash character varying NO And MD5 hash of the file data. Used to compare files and search for identical versions.
metadata jsonb YES A JSON dictionary containing metadata relating to the file.
name character varying NO The name for the file.
path character varying NO A path of the file, relative to the root directory where files are stored.
updated_on timestamp without time zone NO The update time of the file record, not necessarily the file itself (this should be stored in metadata).

Table: file_type

A list of file types.

Columns in "file_type"
Name Type Nullable Documentation
name character varying NO The name of the file type.
short_code character varying NO A short code for referencing the file type in import documents.

Table: library

This table stores a partial record of documents, books and papers that can be referenced by other entities. The ISBN and DOI fields are set to unique, but these may vary (in representation, at least) for a single document so care should be taken not to add duplicates. However, updated papers with the same title and author, but different date, are not disallowed.

Columns in "library"
Name Type Nullable Documentation
abstract text YES The abstract of the entry.
authors jsonb YES The (list of) author(s) of the document. This is a JSON list of objects containing whatever information is necessary. Authors should be listed with at least first_name and last_name, and any other relevant information, such as email or institution.
created_on timestamp without time zone YES The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
doi character varying YES The DOI of the document.
file_id integer NO An optional reference to a file.
institution character varying YES The name of the institution or publisher responsible for the document.
isbn character varying YES The ISBN of the book, if it is a book.
issn character varying YES The ISSN of the entry.
keywords jsonb YES A list of keywords relating to the entry.
mendeley_id character varying YES The ID of the record in Mendeley.
publication character varying YES The name of the publication in which the document appeared.
title text NO The title of the book, paper, or other document.
type character varying YES Describes the type of entry: book, article, etc.
updated_on timestamp without time zone YES The update time of the file record, not necessarily the file itself (this should be stored in metadata).
year character varying YES The publishing date of the document.

Table: mseauser

Represents an MSEA user and is linked to a single Django auth User. Stores extra application-related properties such as the Biigle API key.

Columns in "mseauser"
Name Type Nullable Documentation
allowed boolean NO If true, the user is allowed to sign in. This can be set to false during sign up (e.g., by failing the IP check) or by an admin.
biigle_api_key character varying YES The Biigle API key.
biigle_username character varying YES The Biigle username.
bio text YES Biographical information about the user.
ip_in_region boolean YES Set to true if the user's IP is within the signup region. False positives and negatives are possible.
org_type character varying YES The the type of organization with which the user is affiliated.
organization character varying YES The organization with which a user is affiliated.
pg_role character varying YES The name of the PostgreSQL role that the user will use to log in directly to the database.
registration_ip inet YES The IP used by the user to register.
registration_note text YES Administrator notes about the user's registration status.
registration_reason text YES A short note about why the user registered.
user_id integer NO A reference to the Django user.
verification_code character YES An auto-generated string used to identify the user for verification purposes.
verification_expiry timestamp without time zone YES The time of expiration of the verification code.
verification_time timestamp without time zone YES The date and time at which the user was verified.

Table: organisation

Convenient storage for organisations involved in MSEA activities.

Columns in "organisation"
Name Type Nullable Documentation
country character varying NO The code for the country where the organisation is based (e.g., "CA" for Canada).
name character varying NO The full name of the organisation.
note text YES An optional note about the organisation.

Table: person

Stores information about people involved in all aspects of the application. This is not intended to be a comprehensive duplicate of the individual's HR dossier, just a means of representing a person and providing a means of associating it with a real-world individual, e.g., by their email.

Columns in "person"
Name Type Nullable Documentation
affiliation character varying YES The organization with which this user is currently affiliated.
biigle_user_id integer YES The Biigle database ID of a user. The UUID should be used instead.
biigle_uuid character YES The Biigle UUID is used to identify the user in Biigle apps.
bio text YES A brief biography of the person.
email USER-DEFINED YES Email address.
first_name character varying NO First name.
last_name character varying NO Last name.
photo bytea YES A photo of the person.

Table: restriction

The restriction table provides restrictions for events, based on specific property keys and values. If any event has a key and matching value in a restriction, the event is not shown to non-administrators.

Columns in "restriction"
Name Type Nullable Documentation
created_on timestamp without time zone NO The date of creation of the restriction.
key character varying NO The top-level property name or key.
name character varying NO The name of the restriction.
note text YES An optional note about the restriction.
pattern text NO A pattern matching the property value using the SQL ILIKE operator. An exact (case-insensitive) match is a bare string, while appending % at any location is a wildcard match. For example, '%term' matches 'exterm' but not 'exterminate'.
updated_on timestamp without time zone NO The date of last update of the restriction.

Table: restriction_group

Links the restriction to a group. Members of linked groups are able to view the restricted items.

Columns in "restriction_group"
Name Type Nullable Documentation
group_id integer NO The ID of the Django authentication group.
restriction_id integer NO The ID of the restriction.

Table: site

Contains the names and geographic boundaries of study sites. This will be useful not only for mapping but for querying data by spatial extent.

Columns in "site"
Name Type Nullable Documentation
name character varying NO A name for the site.
note text YES An optional note about the site.
spatial_library_id integer YES A reference to the spatial library entry.

Table: spatial_library

Maintains a library of spatial data.

Columns in "spatial_library"
Name Type Nullable Documentation
created_on timestamp without time zone NO The time when this record was created.
file_id integer YES A reference to a related file.
geom geometry YES A vector representation of the object(s), projected into WGS84 (lat/lon) and stored as a geography type.
metadata jsonb YES A JSON object containing metadata related to the spatial object.
name character varying NO A name for the entry.
note text YES A note about this library item.
rast bytea YES A raster.
thumbnail bytea YES A small thumbnail in binary (JPG) form.
updated_on timestamp without time zone NO The date of update of this record.

Table: spatial_library_file

Allows a spatial library entity to own more than one file.

Columns in "spatial_library_file"
Name Type Nullable Documentation
file_id integer NO A link to the file.
spatial_library_id integer NO A link to the spatial library.

Table: uploaded_file

A table to store uploaded files that can be associated with other entities in separate requests. This table is intended to store temporary entities: when an uploaded file has been handled, these records should be deleted.

Columns in "uploaded_file"
Name Type Nullable Documentation
created_on timestamp without time zone NO The time of creation of the record.
expires_on timestamp without time zone NO The expiry time of the file. It may be deleted by a maintenance script after this time.
marked_for_delete boolean NO If true, the file is marked for delete. Otherwise it will not be touched unless there is an age limit set in the daemon.
name character varying NO The original name of the file.
path character varying NO The path to the temporary location of the file.
type character varying NO The guessed MIME type of the file.

Schema: taxonomy

Table: taxon

Stores taxonomic names from a variety of databases in a common format distinguished by source and taxon_id.

Columns in "taxon"
Name Type Nullable Documentation
accepted_taxon_id integer YES The taxon ID of the accepted taxon for this unaccepted taxon. If this column is null, the taxon is accepted.
class character varying YES The "class" name.
common_name character varying YES The common name of the species.
domain character varying YES The domain name.
family character varying YES The family name.
form character varying YES The form name.
genus character varying YES The genus name.
genus_hybrid character varying YES The genus hybrid name.
gigaclass character varying YES The gigaclass name.
hybrid character varying YES The hybrid name.
infraclass character varying YES The infraclass name.
infrakingdom character varying YES The infrakingdom name.
infraorder character varying YES The infraorder name.
infraphylum character varying YES The infraphylum name.
kingdom character varying YES The kingdom name.
megaclass character varying YES The megaclass name.
natio character varying YES The natio name.
no_common_name boolean YES If a search has been performed for a common name and none was found, this prevents the processor from trying again.
order character varying YES The "order" name.
parent_taxon_id integer YES The taxon ID of the taxon's parent taxon. If this column is null, the taxon has no parents.
parvorder character varying YES The parvorder name.
parvphylum character varying YES The parvphylum name.
phylum character varying YES The phylum name.
phylum_division character varying YES The phylum division name.
rank character varying YES The name of the taxonomic rank of the record, e.g., "class", "subspecies", etc.
scientific_name character varying YES The scientific name of the species.
section character varying YES The section name.
series character varying YES The series name.
source character varying NO The name of the source database: "inaturalist", "worms", "obis", etc.
species character varying YES The species name.
subclass character varying YES The subclass name.
subfamily character varying YES The subfamily name.
subform character varying YES The subform name.
subgenus character varying YES The subgenus name.
subkingdom character varying YES The subkingdom name.
suborder character varying YES The suborder name.
subphylum character varying YES The subphylum name.
subphylum_subdivision character varying YES The subphylum division name.
subsection character varying YES The subsection name.
subspecies character varying YES The subspecies name.
subterclass character varying YES The subterclass name.
subtribe character varying YES The subtribe name.
subvariety character varying YES The subvariety name.
superclass character varying YES The superclass name.
superdomain character varying YES The superdomain name.
superfamily character varying YES The superfamily name.
superorder character varying YES The superorder name.
supertribe character varying YES The supertribe name.
taxon_id character varying NO The taxonomic ID from the source database.
tribe character varying YES The tribe name.
variety character varying YES The variety name.