Annotation Database Entity Documentation: Difference between revisions

From MediaWiki
Jump to navigation Jump to search
No edit summary
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
The database is large, complex and relational with a lot of entities describing many facets of ROV operations, measurements and observations.
Database entity documentation is generated automatically from the production database by the Django task, [https://gitlab.com/rskelly/msea-services/-/blob/main/services/shared/tasks/db_documentation.py db_documentation.py]. The script automatically modifies this page, replacing the text between the <!-- BEGIN GENERATED CONTENT --> and <!-- END GENERATED CONTENT --> tags.


= Notes About Specific Entities =
Documentation resides in the database itself, in the form of comments on the relations and columns, and can be created by executing SQL statements in the form,


These notes about specific entities complement the generated documentation below.
    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.';


== [[#rov.dive|rov.dive]] and [[#rov.transect|rov.transect]] ==
Comments on MSEA's tables are managed using DDL, as described on the [[Annotation_Database#Database_Upgrades|Database Upgrades]] page. Many other tables are generated by application frameworks and are not documented.


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.
''Note: this page is auto-generated from the documentation comments in the actual database. Do not edit it directly.''


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.
<!-- BEGIN GENERATED CONTENT -->
<span id="{schema}"></span>


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).
== Schema: admin ==


= Generated Documentation =
Contains tables relevant to the maintenance and operation of the database.


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.
=== Tables ===


The documentation is arranged into conceptual groupings with the following structure.  
<span id="admin.cache_table"></span>


* Schema
==== cache_table ====
** Table
** Materialized View
** View


System and Django tables aren't included. The ID column of each table is also excluded.
A table containing information about cache refreshment procedures and the tables they impact. The cache_refresh_tables procedure will read this table and execute the procedures stored therein.


== Database Comments ==
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| table_name
| Stores the name of the table impacted by the associated cache procedure. Triggers will be disabled on the table, then re-enabled.
|-
| proc_name
| The name of the cache refresh procedure to be called.
|-
| created_on
|
|-
| updated_on
|
|}


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.'
<span id="{schema}"></span>
    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 [[Annotation_Database#Database_Upgrades|Database Upgrades]] page.
== Schema: cache ==


== Generated Entity Documentation ==
Contains cached representations of data tables, intended bypass complex joins to speed data extraction and improve user experience.


''Note: this page is auto-generated from the documentation comments in the actual database. Do not edit it directly.''
=== Tables ===
 
xxx
 
{{#embed:https://msea.dijital.ca/downloads/docs.md}}


<!-- BEGIN GENERATED CONTENT -->
<span id="cache.cruise_stats"></span>
<span id="inaturalist"></span>


== Schema: inaturalist ==
==== cruise_stats ====


Stores data from the [https://www.inaturalist.org iNaturalist] taxonomy catalogue.
Stores compiled statistics for [[#rov.cruise|cruises]].


<span id="inaturalist.observation"></span>
:: {| class="wikitable"
=== Table: observation ===
! Column
 
! Comment
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.
 
{| class="wikitable"  
|+ Columns in "observation"
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| captive_cultivated || boolean || YES || True, if the observation is of a captive or farmed organism.
| cruise_id
| The ID of the [[#rov.cruise|cruise]].
|-
|-
| common_name || character varying || YES || The common name of the organism.
| name
| The name of the [[#rov.cruise|cruise]].
|-
|-
| coordinates_obscured || boolean || YES || Indicates whether the coordinate is obscured for the public.
| leg
| The [[#rov.cruise|cruise]] leg.
|-
|-
| created_at || timestamp with time zone || YES || The time of creation of the record.
| start_date
| The start date of the [[#rov.cruise|cruise]].
|-
|-
| description || text || YES || A description of the observation.
| end_date
| The end date of the [[#rov.cruise|cruise]].
|-
|-
| geoprivacy || character varying || YES || Set to private if the record is not public. TODO: Other values?
| num_dives
| The number of dives performed during the [[#rov.cruise|cruise]].
|-
|-
| iconic_taxon_name || character varying || YES || Grouping by arbitrary taxonomic level.
| num_measurements
| The number measurements collected during the [[#rov.cruise|cruise]].
|-
|-
| image_url || text || YES || A URL for an image of the observation.
| num_positions
| The number positions collected during the [[#rov.cruise|cruise]].
|-
|-
| latitude || real || YES || The latitude of the observation.
| num_habitats
| The number habitats annotated during the [[#rov.cruise|cruise]].
|-
|-
| license || character varying || YES || The license applied to the record.
| num_observations
| The number observations annotated during the [[#rov.cruise|cruise]].
|-
|-
| longitude || real || YES || The longitude of the observation.
| is_approved
|  
|-
|-
| num_identification_agreements || smallint || YES || The number of votes for the identifaction.
| num_transects
| The number of [[#rov.transect|transects]] that occurred during this [[#rov.cruise|cruise]].
|-
|-
| num_identification_disagreements || smallint || YES || Number of votes against the identification.
| num_taxa
| The number of [[#taxonomy.taxon|taxa]] observed during this [[#rov.cruise|cruise]].
|-
|-
| oauth_application_id || character varying || YES || The ID of an OAUTH application used to modify the record.
| num_cruise_crew
| The number of [[#rov.cruise_crew|crew members]] configured for this [[#rov.cruise|cruise]].
|-
|-
| observed_on || date || YES || The time of observation. Created by combining the observed_on and time_observed_at and time_zone fields.
| num_dive_crew
| The number of [[#rov.dive_crew|crew members]] configured for the [[#rov.dive|dives]] of this [[#rov.cruise|cruise]].
|-
|-
| place_guess || character varying || YES || The informal name of the site of the observation.
| num_ap_docs
| The number of [[#rov.annotation_protocol_document|documents]] attached to an [[#rov.annotation_protocol|annotation protocol]] used to annotate this [[#rov.cruise|cruise's]] data.
|-
|-
| positional_accuracy || integer || YES || The positional accuracy of the observation position (m).
| num_cruise_docs
| True if there is at least one [[#rov.cruise_document|document]] attached this [[#rov.cruise|cruise]].
|-
|-
| positioning_device || character varying || YES || The device used to collect the position.
| has_fov
| True if the cruise has field of view measurements.
|}
 
<span id="cache.cruise_track"></span>
 
==== cruise_track ====
 
Constructs a geometry for each [[#rov.cruise|cruise]] which describes the path of the ship.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| positioning_method || character varying || YES || The positioning method.
| cruise_id
| The reference to the [[#rov.cruise|cruise]].
|-
|-
| public_positional_accuracy || integer || YES || The positional accuracy of the position showed to the public (m).
| cruise_name
| The [[#rov.cruise|cruise]] name and leg.
|-
|-
| quality_grade || character varying || YES || The quality of the report. 'research' indicates that the record is authoritative.
| colour
| The a colour code generated from the cruise's ID used for cartography.
|-
|-
| scientific_name || character varying || YES || The scientific name given to the observation.
| geom
| The cruise track geometry.
|}
 
<span id="cache.dive_track"></span>
 
==== dive_track ====
 
Constructs a geometry for each [[#rov.dive|dive]] which describes the path of the submersible.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| sound_url || text || YES || A URL for a sound file for the record.
| dive_id
| The reference to the [[#rov.dive|dive]].
|-
|-
| species_guess || character varying || YES || A guess at the species name.
| cruise_id
| The reference to the [[#rov.cruise|cruise]].
|-
|-
| tag_list || jsonb || YES || A list of tags associated with the observation. Represented as a JSON list.
| dive_name
| The [[#rov.dive|dive]] name.
|-
|-
| taxon_class_name || character varying || YES || The name of the taxon's class.
| cruise_name
| The [[#rov.cruise|cruise]] name.
|-
|-
| taxon_family_name || character varying || YES || The family of the taxon.
| colour
| The a colour code generated from the cruise's ID. Used for cartography.
|-
|-
| taxon_form_name || character varying || YES || The form of the taxon.
| geom
|-
| The dive track geometry.
| taxon_genus_name || character varying || YES || The genus of the taxon.
|}
 
<span id="cache.evt_depth"></span>
 
==== 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"
! Column
! Comment
|-
|-
| taxon_genushybrid_name || character varying || YES || The hybrid genus of the taxon.
| event_id
| The link to the [[#rov.event|event's]] event ID.
|-
|-
| taxon_geoprivacy || character varying || YES || The privacy setting of the taxon. 'open' or 'obscured'.
| instrument_config_id
| The link to the [[#rov.instrument_config|instrument configuration]].
|-
|-
| taxon_hybrid_name || character varying || YES || The hybrid name of the taxon.
| timestamps
| The array of timestamps corresponding to the depths.
|-
|-
| taxon_id || integer || NO || The iNaturalist taxon ID.
| depths
| The array of [[#rov.measurement|depths]] between the event's start and end times. If the event covers a span of time, multiple depths are returned.
|}
 
<span id="cache.evt_measurement"></span>
 
==== evt_measurement ====
 
Creates a relation between an [[#rov.event|event]] and the [[#rov.measurement|measurement]] nearest the start and end times of the event.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| taxon_kingdom_name || character varying || YES || The taxon' kingdom.
| event_id
| The link to the [[#rov.event|event's]] event ID.
|-
|-
| taxon_order_name || character varying || YES || The order of the taxon.
| instrument_config_id
| The link to the [[#rov.instrument_config|instrument configuration]].
|-
|-
| taxon_phylum_name || character varying || YES || The taxon phylum.
| measurement_type_id
| The link to the [[#rov.measurement_type|measurement type]].
|-
|-
| taxon_species_name || character varying || YES || The species of the taxon.
| timestamps
| The array of timestamps corresponding to the measurements.
|-
|-
| taxon_subclass_name || character varying || YES || The taxon's subclass.
| measurements
| The array of [[#rov.measurement|measurements]] between the event's start and end times. If the event covers a span of time, multiple measurements are returned.
|}
 
<span id="cache.evt_pos"></span>
 
==== evt_pos ====
 
Creates a relation between an [[#rov.event|event]] and the [[#rov.position|positions]] within the span of the event, as a MultiPoint.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| taxon_subfamily_name || character varying || YES || The subfamily of the taxon.
| event_id
| The link to the [[#rov.event|event's]]'s event ID.
|-
|-
| taxon_suborder_name || character varying || YES || The suborder of a taxon.
| instrument_config_id
| The link to the [[#rov.instrument_config|instrument configuration]].
|-
|-
| taxon_subphylum_name || character varying || YES || The taxon subphylum.
| timestamps
| The list of timestamps corresponding to the geometries in the geoms column.
|-
|-
| taxon_subspecies_name || character varying || YES || The subspecies of the taxon.
| geoms
|-
| The list of positions comprising the ROV track during the time span of the event. A MultiPoint.
| taxon_subtribe_name || character varying || YES || The subtribe of the taxon.
|}
|-
 
| taxon_superclass_name || character varying || YES || The taxon superclass.
<span id="cache.transect_track"></span>
|-
 
| taxon_superfamily_name || character varying || YES || The taxon's superfamily.
==== transect_track ====
 
Constructs a geometry for each [[#rov.transect|transect]] which describes the path of the submersible.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| taxon_superorder_name || character varying || YES || The superorder of the taxon.
| transect_id
| The reference to the [[#rov.transect|transect]].
|-
|-
| taxon_supertribe_name || character varying || YES || The supertribe of the taxon.
| dive_id
| The reference to the [[#rov.dive|dive]].
|-
|-
| taxon_tribe_name || character varying || YES || The tribe of the taxon.
| cruise_id
| The reference to the [[#rov.cruise|cruise]].
|-
|-
| taxon_variety_name || character varying || YES || The variety name of the taxon.
| transect_name
| The [[#rov.transect|transect]] name.
|-
|-
| updated_at || timestamp with time zone || YES || The time of update of the record.
| dive_name
| The [[#rov.dive|dive]] name.
|-
|-
| url || text || YES || A URL pointing to the online record.
| cruise_name
| The [[#rov.cruise|cruise]] name.
|-
|-
| user_id || integer || YES || The ID of the iNaturalist user.
| colour
| The a colour code generated from the cruise's ID. Used for cartography.
|-
|-
| user_login || character varying || YES || The login name of the iNaturalist user.
| geom
| The transect track geometry.
|}
|}


<span id="intertidal"></span>
== Schema: intertidal ==


Stores data for the intertidal database. Contains information about UAS flights, surveys and other derivative data.
<span id="{schema}"></span>
 
== Schema: geo ==
 
Contains spatial objects, such as vectors which can be visualized on a map or used to query other tables.
 
=== Tables ===


<span id="intertidal.quadrat"></span>
<span id="geo.area"></span>
=== Table: quadrat ===


A record of observations within an intertidal quadrat.
==== area ====


{| class="wikitable"  
Stores area geometries linked to [[#geo.area_group|area groups]].
|+ Columns in "quadrat"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| centroid_height || real || YES || The elevation of the corner position in m (ellipsoidal).
| area_group_id
|  
|-
|-
| centroid_lat || double precision || YES || The corner latitude.
| name_en
| The english name of the area.
|-
|-
| centroid_lon || double precision || YES || The corner longitude.
| name_fr
| The french name of the area.
|-
|-
| corner_height1 || real || YES || The elevation of the corner position in m (ellipsoidal).
| properties
| A JSON object containing properties of the area.
|-
|-
| corner_height2 || real || YES || The elevation of the corner position in m (ellipsoidal).
| geom
|-
| The area geometry, a MultiPolygon.
| corner_height3 || real || YES || The elevation of the corner position in m (ellipsoidal).
|}
 
<span id="geo.area_group"></span>
 
==== area_group ====
 
Stores groups of similar areas, such as MPAs, seamounts, etc. Linked by [[#geo.area|areas]].
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| corner_height4 || real || YES || The elevation of the corner position in m (ellipsoidal).
| id
|  
|-
|-
| corner_lat1 || double precision || YES || The corner latitude.
| name_en
| The english name of the area group.
|-
|-
| corner_lat2 || double precision || YES || The corner latitude.
| name_fr
| The french name of the area group.
|-
|-
| corner_lat3 || double precision || YES || The corner latitude.
| description_en
| The english description of the area group.
|-
|-
| corner_lat4 || double precision || YES || The corner latitude.
| description_fr
| The french description of the area group.
|}
 
 
<span id="{schema}"></span>
 
== Schema: maxmind ==
 
Contains data provided by Maxmind, which provides geolocation of users based on their IP address.
 
=== Tables ===
 
<span id="maxmind.geoip_city_blocks"></span>
 
==== geoip_city_blocks ====
 
Contains both IPv4 and IPv6 network addresses, which reference locations in the [[#maxmind.geoip_city_locations|geoip_city_locations]] table.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| corner_lon1 || double precision || YES || The corner longitude.
| network
| The network address, IPv4 or IPv6.
|-
|-
| corner_lon2 || double precision || YES || The corner longitude.
| geoname_id
| References the location ID in the [[#maxmind.geoip_city_locations|geoip_city_locations]] table.
|-
|-
| corner_lon3 || double precision || YES || The corner longitude.
| registered_country_geoname_id
| The location ID in the [[#maxmind.geoip_city_locations|geoip_city_locations]] table which is registered to the network address.
|-
|-
| corner_lon4 || double precision || YES || The corner longitude.
| represented_country_geoname_id
| The location ID in the [[#maxmind.geoip_city_locations|geoip_city_locations]] table from which the IP comes.  
|-
|-
| created_on || timestamp without time zone || NO || created_on = models.DateTimeField(default = datetime.utcnow, null = False)
| is_anonymous_proxy
| True if the address is of an anonymous proxy.
|-
|-
| flag_number || character varying || NO || The number of the flag used to mark the quadrat. May be non-numeric if necessary.
| is_satellite_provider
| True if the address is used by a satellite network provider.
|-
|-
| geom || geometry || YES || A geometry representing either the corners of the quadrat (multipoint) or the centroid.
| postal_code
| The postal code of the location.
|-
|-
| name || character varying || NO || A unique name for the quadrat.
| latitude
| The latitude of the geographic center of a region, defined by the accuracy radius, which contains the location.
|-
|-
| note || text || YES || An optional note about the quadrat.
| longitude
| The longitude of the geographic center of a region, defined by the accuracy radius, which contains the location.
|-
|-
| survey_id || integer || NO || A reference to the [[#intertidal.survey|intertidal suvey]].
| accuracy_radius
| The radius (m) of a circle within which the location is located.
|-
|-
| time || timestamp without time zone || NO || The time of the quadrat (UTC).
| is_anycast
| True if the address is that of an Anycast network.
|-
|-
| transect || integer || NO || The transect number. This is an integer corresponding to whatever rubric was chosen for the survey.
| location
|  
|-
|-
| zone || integer || NO || The zone number. This is an integer corresponding to whatever rubric was chosen for the survey.
| region
|  
|}
|}


<span id="intertidal.quadrat_observation"></span>
<span id="maxmind.geoip_city_locations"></span>
=== Table: quadrat_observation ===


Records observations within [[#intertidal.quadrat|quadrats]]. The observation type enumeration is defined in the database export panel.
==== geoip_city_locations ====


{| class="wikitable"  
Stores the country, region and city data for GeoIP.
|+ Columns in "quadrat_observation"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| geoname_id
| The internal GeoIP city ID.
|-
|-
| cell || integer || YES || The quadrat cell, typically from 0 - 100.
| locale_code
| The two-character local code.
|-
|-
| count || integer || YES || The number of organisms observed.
| continent_code
| The two-character ISO continent code.
|-
|-
| coverage || real || YES || The percent coverage by the organism, 0-100. TODO: Not part of the specification.
| continent_name
| The continent name
|-
|-
| length || real || YES || The measured length of an organism.
| country_iso_code
| The two-character ISO country code.
|-
|-
| quadrat_id || integer || NO || A link to the [[#intertidal.quadrat|quadrat]].
| country_name
| The country name
|-
|-
| surveytaxon_id || integer || NO || A link to the [[#intertidal.survey_taxon|survey taxon]].
| subdivision_1_iso_code
| The ISO subdivision 1 code.
|-
|-
| type || integer || YES || The type of observation; one of quadrat_obs_type.
| subdivision_1_name
| The ISO subdivision 1 name.
|-
| subdivision_2_iso_code
| The ISO subdivision 2 code.
|-
| subdivision_2_name
| The ISO subdivision 2 name.
|-
| city_name
| The city name.
|-
| metro_code
| The three-digit metro code.
|-
| time_zone
| The name of the time zone.
|-
| is_in_european_union
| True if the location is within the European Union.
|}
|}


<span id="intertidal.quadrat_substrate"></span>
<span id="maxmind.geoip_last_update"></span>
=== Table: quadrat_substrate ===


List substrates observed in intertidal quadrats.
==== geoip_last_update ====


{| class="wikitable"  
Stores the time of last update of the database.
|+ Columns in "quadrat_substrate"
 
|-
:: {| class="wikitable"
! Name !! Type !! Nullable !! Documentation
! Column
! Comment
|-
|-
| name || character varying || NO || The name of the substrate.
| last_update
| The time of last update of the database.
|}
|}


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


Associates [[#intertidal.quadrat_substrate|quadrat substrate]] coverages with [[#intertidal.quadrats|quadrats]].
<span id="{schema}"></span>


{| class="wikitable"
== Schema: ndst ==
|+ 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 [[#intertidal.quadrat|quadrat]].
|-
| substrate_id || integer || NO || A reference to the [[#intertidal.quadrat_substrate|substrate]].
|}


<span id="intertidal.survey"></span>
Tables related to the dive logging Shiny App used by NDST to record cruise data.
=== Table: survey ===


Stores metadata about intertidal surveys.
=== Tables ===


{| class="wikitable"  
<span id="ndst.cruise"></span>
|+ Columns in "survey"
 
==== 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"
! Column
! Comment
|-
| row_id
| A UUID providing a universally-unique identifier for the cruise.
|-
| name
| The name of the cruise.
|-
| leg
| The leg of the cruise. Should start at 1 and increase.
|-
| objective
|  
|-
|-
! Name !! Type !! Nullable !! Documentation
| summary
| A summary of the cruise, its accomplishments, problems, etc.
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of this record.
| note
| The objective of the cruise.
|-
|-
| end_date || timestamp without time zone || YES || The end date of the survey.
| status
| The current status of the cruise viz. database import.
|-
|-
| name || character varying || NO || The name of the survey.
| created_on
| The date and time of creation of the entity.
|-
|-
| note || text || YES || Notes about the survey.
| updated_on
| The date and time of the entity's last update.
|-
|-
| objective || text || YES || The survey objective.
| id
|  
|-
|-
| site_id || integer || YES || Relates the survey to a [[#shared.site|site]] entity.
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
|-
| start_date || timestamp without time zone || NO || The start date of the survey.
| hide
| True if the entity should be hidden in the UI.
|}
|}


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


Associates [[#intertidal.survey|intertidal survey]] crew members with [[#intertidal.survey_role|roles]].
==== diveconfig ====


{| class="wikitable"  
Stores configurations for each dive, including the submersible, ship and any instruments on either.
|+ Columns in "survey_crew"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
|-
| note || text || YES || An optional note about the survey role.
| name
| The name of the dive config.
|-
|-
| person_id || integer || NO || A reference to the person with this [[#shared.person|role]].
| ship_config
| Stores the name of the [[#ndst.equipconfig|ship configuration]] during the dive.
|-
|-
| role_id || integer || NO || A reference to the [[#intertidal.survey_role|role]].
| sub_config
| Stores the name of the [[#ndst.equipconfig|submersible configuration]] during the dive.
|-
|-
| survey_id || integer || NO || A reference to the [[#intertidal.survey|survey]].
| ship_instrument_configs
|}
| Stores the names of the [[#ndst.equipconfig|instruments]] on the ship during the dive.
 
<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"
|-
|-
! Name !! Type !! Nullable !! Documentation
| sub_instrument_configs
| Stores the names of the [[#ndst.equipconfig|instruments]] on the sub during the dive.
|-
|-
| name || character varying || NO || The name of the role.
| note
| A note about the dive config.
|-
|-
| note || text || YES || A note about the role.
| active
|}
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
 
<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"
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| survey_id || integer || NO || A link to the [[#intertidal.survey|survey]].
| created_on
| The date and time of creation of the entity.
|-
|-
| taxon_id || integer || NO || A link to the [[#shared.taxon|taxon]] record.
| updated_on
| The date and time of the entity's last update.
|}
|}


<span id="ndst"></span>
<span id="ndst.dives"></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.
==== dives ====


<span id="ndst.cruise"></span>
Stores information about each dive.
=== Table: cruise ===


None
:: {| class="wikitable"
 
! Column
{| class="wikitable"  
! Comment
|+ Columns in "cruise"
|-
! Name !! Type !! Nullable !! Documentation
|-
|-
| active || boolean || NO || [None]
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
|-
| created_on || timestamp without time zone || NO || [None]
| cruise_name
| The name of the [[#ndst.cruise|cruise]].
|-
|-
| leg || text || YES || [None]
| leg
| The leg of the [[#ndst.cruise|cruise]].
|-
|-
| name || text || YES || [None]
| name
| The name of the dive.
|-
|-
| note || text || YES || [None]
| pilot
| The [[#shared.person|pilot]](s) of the dive.
|-
|-
| objective || text || YES || [None]
| start_time
| The time of dive start.
|-
|-
| row_id || text || YES || [None]
| end_time
| The time of dive ending.
|-
|-
| status || character varying || YES || [None]
| site_name
| The name of the dive site.
|-
|-
| summary || text || YES || [None]
| dive_config
| The name of the [[#ndst.diveconfig|dive configuration]].
|-
|-
| updated_on || timestamp without time zone || NO || [None]
| objective
|}
| The objective of the dive.
 
<span id="ndst.diveconfig"></span>
=== Table: diveconfig ===
 
None
 
{| class="wikitable"
|+ Columns in "diveconfig"
|-
|-
! Name !! Type !! Nullable !! Documentation
| summary
| A summary of the dive, its accomplishments, problems, etc.
|-
|-
| active || boolean || NO || [None]
| note
| A note about the dive.
|-
|-
| name || text || YES || [None]
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
|-
| note || text || YES || [None]
| hide
| True if the entity should be hidden in the UI.
|-
|-
| row_id || text || YES || [None]
| id
|  
|-
|-
| ship_config || text || YES || [None]
| created_on
| The date and time of creation of the entity.
|-
|-
| ship_instrument_configs || text || YES || [None]
| updated_on
|-
| The date and time of the entity's last update.
| sub_config || text || YES || [None]
|-
| sub_instrument_configs || text || YES || [None]
|}
|}


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


None
Stores configurations for [[#ndst.equipment|equipment]], including instruments and platforms.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "dives"
! Column
|-
! Comment
! Name !! Type !! Nullable !! Documentation
|-
| active || boolean || NO || [None]
|-
| cruise_name || text || YES || [None]
|-
| dive_config || text || YES || [None]
|-
|-
| end_time || text || YES || [None]
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
|-
| leg || text || YES || [None]
| name
| The name of the equipment config.
|-
|-
| name || text || YES || [None]
| short_code
| A short, easy-to-use identifier for the configuration.
|-
|-
| note || text || YES || [None]
| type
| The type of equipment.
|-
|-
| objective || text || YES || [None]
| configuration
| A JSON object containing configuration properties.
|-
|-
| pilot || text || YES || [None]
| note
| A note about the equipment config.
|-
|-
| row_id || text || YES || [None]
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
|-
| site_name || text || YES || [None]
| id
|  
|-
|-
| start_time || text || YES || [None]
| created_on
| The date and time of creation of the entity.
|-
|-
| summary || text || YES || [None]
| updated_on
| The date and time of the entity's last update.
|}
|}


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


None
Stores equipment, including instruments and platforms.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "equipconfig"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
|-
| active || boolean || NO || [None]
| short_code
| The short code for the equipment as used in the [[#ndst.equipment|ROV database equipment table]].
|-
|-
| configuration || text || YES || [None]
| brand
| The brand name of the equipment.
|-
|-
| name || text || YES || [None]
| model
| The model name of the equipment.
|-
|-
| note || text || YES || [None]
| serial_number
| The serial number.
|-
|-
| row_id || text || YES || [None]
| type
| The type of equipment.
|-
|-
| short_code || text || YES || [None]
| note
| A note about the equipment.
|-
|-
| type || text || YES || [None]
| instrument_id
|}
| The ID of the [[#rov.instrument|instrument]] in the ROV database. Mutually exclusive with platform_id.
 
<span id="ndst.equipment"></span>
=== Table: equipment ===
 
None
 
{| class="wikitable"
|+ Columns in "equipment"
|-
|-
! Name !! Type !! Nullable !! Documentation
| platform_id
| The ID of the [[#rov.platform|platform]] in the ROV database. Mutually exclusive with instrument_id.
|-
|-
| active || boolean || NO || [None]
| short_code_mapped
| 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.
|-
|-
| brand || text || YES || [None]
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
|-
| instrument_id || integer || YES || [None]
| id
|  
|-
|-
| model || text || YES || [None]
| created_on
| The date and time of creation of the entity.
|-
|-
| note || text || YES || [None]
| updated_on
|-
| The date and time of the entity's last update.
| platform_id || integer || YES || [None]
|-
| 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="ndst.people"></span>
=== Table: people ===


None
==== people ====
 
Stores the people who worked on the [[#ndst.cruise|cruise]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "people"
! Column
! Comment
|-
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
| initials
| The initials. Used like a short code for the person.
|-
|-
! Name !! Type !! Nullable !! Documentation
| first_name
| The first name.
|-
|-
| active || boolean || NO || [None]
| last_name
| The last name.
|-
|-
| email || text || YES || [None]
| email
| The email address.
|-
|-
| first_name || text || YES || [None]
| person_id
| The ID of the [[#shared.person|person]] in the ROV database.
|-
|-
| initials || text || YES || [None]
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
|-
| last_name || text || YES || [None]
| id
|  
|-
|-
| person_id || integer || YES || [None]
| created_on
| The date and time of creation of the entity.
|-
|-
| row_id || text || YES || [None]
| updated_on
| The date and time of the entity's last update.
|}
|}


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


None
==== transects ====
 
Stores information about each transect.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "transects"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
|-
| active || boolean || NO || [None]
| cruise_name
| The name of the [[#ndst.cruise|cruise]].
|-
|-
| cruise_name || text || YES || [None]
| leg
| The leg of the [[#ndst.cruise|cruise]].
|-
|-
| dive_name || text || YES || [None]
| dive_name
| The name of the dive.
|-
|-
| end_time || text || YES || [None]
| name
| The name of the transect.
|-
|-
| leg || text || YES || [None]
| start_time
| The time of transect start.
|-
|-
| name || text || YES || [None]
| end_time
| The time of transect ending.
|-
|-
| note || text || YES || [None]
| objective
| The objective of the transect.
|-
|-
| objective || text || YES || [None]
| summary
| A summary of the transect, its accomplishments, problems, etc.
|-
|-
| row_id || text || YES || [None]
| note
| A note about the transect.
|-
|-
| start_time || text || YES || [None]
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
|-
| summary || text || YES || [None]
| hide
| True if the entity should be hidden in the UI.
|-
| id
|  
|-
| created_on
| The date and time of creation of the entity.
|-
| updated_on
| The date and time of the entity's last update.
|}
|}


<span id="obis"></span>
== Schema: obis ==


Stores data from the [https://obis.org OBIS] taxonomy and observation database.
<span id="{schema}"></span>


<span id="obis.taxon"></span>
== Schema: public ==
=== Table: taxon ===


OBIS taxonomy records imported directly from the OBIS observation data, but filtered for uniqueness on the Aphia ID.
The default schema used for system tables and tables installed by application frameworks such as Django, Celery and Knox. These are generally not documented.


{| class="wikitable"  
=== Tables ===
|+ Columns in "taxon"
 
<span id="public.auth_group"></span>
 
==== auth_group ====
 
A Django table for authorization groups.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| aphiaid || integer || NO || [None]
| name
|  
|}
 
<span id="public.auth_group_permissions"></span>
 
==== auth_group_permissions ====
 
A Django table for permissions on authorization groups.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| class || character varying || YES || [None]
| id
|  
|-
|-
| domain || character varying || YES || [None]
| group_id
|  
|-
|-
| family || character varying || YES || [None]
| permission_id
|  
|}
 
<span id="public.auth_permission"></span>
 
==== auth_permission ====
 
A Django table for available permissions.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| forma || character varying || YES || [None]
| id
|  
|-
|-
| genus || character varying || YES || [None]
| name
|  
|-
|-
| gigaclass || character varying || YES || [None]
| content_type_id
|  
|-
|-
| infraclass || character varying || YES || [None]
| codename
|  
|}
 
<span id="public.auth_user"></span>
 
==== auth_user ====
 
A Django table for users.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| infrakingdom || character varying || YES || [None]
| id
|  
|-
|-
| infraorder || character varying || YES || [None]
| password
|  
|-
|-
| infraphylum || character varying || YES || [None]
| last_login
|  
|-
|-
| kingdom || character varying || YES || [None]
| is_superuser
|  
|-
|-
| megaclass || character varying || YES || [None]
| first_name
|  
|-
|-
| natio || character varying || YES || [None]
| last_name
|  
|-
|-
| order || character varying || YES || [None]
| email
|  
|-
|-
| organismname || character varying || YES || [None]
| is_staff
|  
|-
|-
| originalscientificname || character varying || YES || [None]
| is_active
|  
|-
|-
| parvorder || character varying || YES || [None]
| date_joined
|  
|-
|-
| parvphylum || character varying || YES || [None]
| biigle_username
|  
|-
|-
| phylum || character varying || YES || [None]
| biigle_api_key
|  
|-
|-
| phylum_division || character varying || YES || [None]
| organization
|  
|-
|-
| scientificname || character varying || NO || [None]
| org_type
|  
|-
|-
| section || character varying || YES || [None]
| registration_reason
|  
|-
|-
| series || character varying || YES || [None]
| bio
|  
|-
|-
| species || character varying || YES || [None]
| verification_code
|  
|-
|-
| subclass || character varying || YES || [None]
| verification_expiry
|  
|-
|-
| subfamily || character varying || YES || [None]
| verification_time
|  
|-
|-
| subforma || character varying || YES || [None]
| registration_ip
|  
|-
|-
| subgenus || character varying || YES || [None]
| ip_in_region
|  
|-
|-
| subkingdom || character varying || YES || [None]
| registration_note
|  
|-
|-
| suborder || character varying || YES || [None]
| allowed
|  
|-
|-
| subphylum || character varying || YES || [None]
| password_reset_code
|  
|-
|-
| subphylum_subdivision || character varying || YES || [None]
| password_reset_expiry
|  
|-
|-
| subsection || character varying || YES || [None]
| registration_location
|  
|}
 
<span id="public.auth_user_groups"></span>
 
==== auth_user_groups ====
 
A Django table to relate users to groups.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| subspecies || character varying || YES || [None]
| id
|  
|-
|-
| subterclass || character varying || YES || [None]
| user_id
|  
|-
|-
| subtribe || character varying || YES || [None]
| group_id
|  
|}
 
<span id="public.auth_user_user_permissions"></span>
 
==== auth_user_user_permissions ====
 
A Django for user permissions.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| subvariety || character varying || YES || [None]
| id
|  
|-
|-
| superclass || character varying || YES || [None]
| user_id
|  
|-
|-
| superdomain || character varying || YES || [None]
| permission_id
|  
|}
 
<span id="public.django_admin_log"></span>
 
==== django_admin_log ====
 
A Django table for admin logging.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| superfamily || character varying || YES || [None]
| id
|  
|-
|-
| superorder || character varying || YES || [None]
| action_time
|  
|-
|-
| supertribe || character varying || YES || [None]
| object_id
|  
|-
|-
| taxonid || character varying || YES || [None]
| object_repr
|  
|-
|-
| taxonomicstatus || character varying || YES || [None]
| action_flag
|  
|-
|-
| taxonrank || character varying || YES || [None]
| change_message
|  
|-
|-
| taxonremarks || text || YES || [None]
| content_type_id
|  
|-
|-
| tribe || character varying || YES || [None]
| user_id
|  
|}
 
<span id="public.django_celery_beat_clockedschedule"></span>
 
==== django_celery_beat_clockedschedule ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| type || character varying || YES || [None]
| id
|  
|-
|-
| variety || character varying || YES || [None]
| clocked_time
|-
|  
| vernacularname || character varying || YES || [None]
|}
|}


<span id="pa"></span>
<span id="public.django_celery_beat_crontabschedule"></span>
== Schema: pa ==
 
Stores data about protected areas, including RCAs, parks, etc.
 
<span id="pa.mpa"></span>
=== Table: mpa ===


None
==== django_celery_beat_crontabschedule ====


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "mpa"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| aichi_t11 || character varying || YES || [None]
| minute
|  
|-
|-
| biome || character varying || YES || [None]
| hour
|  
|-
|-
| comments || character varying || YES || [None]
| day_of_week
|  
|-
|-
| delisdate || integer || YES || [None]
| day_of_month
|  
|-
|-
| geom || geometry || YES || [None]
| month_of_year
|  
|-
|-
| geometry || USER-DEFINED || YES || [None]
| timezone
|  
|}
 
<span id="public.django_celery_beat_intervalschedule"></span>
 
==== django_celery_beat_intervalschedule ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| gov_type || character varying || YES || [None]
| id
|  
|-
|-
| iucn_cat || character varying || YES || [None]
| every
|  
|-
|-
| jur_id || character varying || YES || [None]
| period
|  
|}
 
<span id="public.django_celery_beat_periodictask"></span>
 
==== django_celery_beat_periodictask ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| legisl_e || character varying || YES || [None]
| id
|  
|-
|-
| legisl_f || character varying || YES || [None]
| name
|  
|-
|-
| loc_e || character varying || YES || [None]
| task
|  
|-
|-
| loc_f || character varying || YES || [None]
| args
|  
|-
|-
| mgmt_e || character varying || YES || [None]
| kwargs
|  
|-
|-
| mgmt_f || character varying || YES || [None]
| queue
|  
|-
|-
| name_e || character varying || YES || [None]
| exchange
|  
|-
|-
| name_f || character varying || YES || [None]
| routing_key
|  
|-
|-
| name_ind || character varying || YES || [None]
| expires
|  
|-
|-
| o_area || double precision || YES || [None]
| enabled
|  
|-
|-
| objectid || bigint || NO || [None]
| last_run_at
|  
|-
|-
| oecm || character varying || YES || [None]
| total_run_count
|  
|-
|-
| ogc_fid || integer || NO || [None]
| date_changed
|  
|-
|-
| owner_e || character varying || YES || [None]
| description
|  
|-
|-
| owner_f || character varying || YES || [None]
| crontab_id
|  
|-
|-
| parent_id || integer || YES || [None]
| interval_id
|  
|-
|-
| protdate || integer || YES || [None]
| solar_id
|  
|-
|-
| shape_area || double precision || YES || [None]
| one_off
|  
|-
|-
| shape_length || double precision || YES || [None]
| start_time
|  
|-
|-
| status_e || character varying || YES || [None]
| priority
|  
|-
|-
| status_f || character varying || YES || [None]
| headers
|  
|-
|-
| subs_right || character varying || YES || [None]
| clocked_id
|  
|-
| expire_seconds
|  
|}
 
<span id="public.django_celery_beat_periodictasks"></span>
 
==== django_celery_beat_periodictasks ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| type_e || character varying || YES || [None]
| ident
|  
|-
|-
| type_f || character varying || YES || [None]
| last_update
|  
|}
 
<span id="public.django_celery_beat_solarschedule"></span>
 
==== django_celery_beat_solarschedule ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| url || character varying || YES || [None]
| id
|  
|-
|-
| zone_id || integer || YES || [None]
| event
|  
|-
|-
| zonedesc_e || character varying || YES || [None]
| latitude
|  
|-
|-
| zonedesc_f || character varying || YES || [None]
| longitude
|  
|}
|}


<span id="pa.mpa_data_object"></span>
<span id="public.django_celery_results_chordcounter"></span>
=== Table: mpa_data_object ===


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.
==== django_celery_results_chordcounter ====


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "mpa_data_object"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
| group_id
|  
|-
|-
| description || text || YES || A description of the object.
| sub_tasks
|  
|-
|-
| doi || character varying || YES || The DOI of the object.
| count
|  
|}
 
<span id="public.django_celery_results_groupresult"></span>
 
==== django_celery_results_groupresult ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| isbn || character varying || YES || The ISBN of the object.
| id
|  
|-
|-
| mpa_id || integer || NO || A reference to the [[#mpa.mpa|MPA]] record.
| group_id
|  
|-
|-
| name || character varying || NO || The name of the data object.
| date_created
|  
|-
|-
| updated_on || timestamp without time zone || NO || The last update time of the object.
| date_done
|}
|  
 
<span id="pa.mpa_data_object_file"></span>
=== Table: mpa_data_object_file ===
 
Gives the ability for more than one [[#mpa.data_object|data object]] to own a [[#shared.file|file]] and vice versa.
 
{| class="wikitable"
|+ Columns in "mpa_data_object_file"
|-
|-
! Name !! Type !! Nullable !! Documentation
| content_type
|
|-
|-
| data_object_id || integer || NO || A reference to the [[#mpa.data_object|data object]].
| content_encoding
|  
|-
|-
| file_id || integer || NO || A reference to the [[#shared.file|file]].
| result
|  
|}
|}


<span id="pa.protected_area"></span>
<span id="public.django_celery_results_taskresult"></span>
=== Table: protected_area ===


A unified table for protected areas.
==== django_celery_results_taskresult ====


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "protected_area"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| area || real || YES || The nominal area in sq. km of the protected area.
| task_id
|  
|-
|-
| geom || geometry || NO || The boundary geometry of the protected area.
| status
|  
|-
|-
| name_e || character varying || NO || The English name of the protected area.
| content_type
|  
|-
|-
| name_f || character varying || NO || The French name of the protected area.
| content_encoding
|  
|-
|-
| note || text || YES || An optional note about the protected area.
| result
|  
|-
|-
| original_id || integer || YES || The original ID of the protected area, from the source database.
| date_done
|  
|-
|-
| type || character varying || NO || The type of protected area, including "RCA", "MPA", etc.
| traceback
|  
|-
|-
| year_created || integer || YES || The year of creation of the protected area.
| meta
|}
|  
 
<span id="pa.protected_area_data_object"></span>
=== Table: protected_area_data_object ===
 
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.
 
{| class="wikitable"
|+ Columns in "protected_area_data_object"
|-
|-
! Name !! Type !! Nullable !! Documentation
| task_args
|
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
| task_kwargs
|  
|-
|-
| description || text || YES || A description of the object.
| task_name
|  
|-
|-
| doi || character varying || YES || The DOI of the object.
| worker
|  
|-
|-
| isbn || character varying || YES || The ISBN of the object.
| date_created
|  
|-
|-
| name || character varying || NO || The name of the data object.
| periodic_task_name
|  
|-
|-
| protected_area_id || integer || YES || A link to the [[#pa.protected_area|protected area]].
| date_started
|-
|  
| 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="public.django_content_type"></span>
=== Table: protected_area_data_object_file ===


Gives the ability for more than one [[#rca.data_object|data object]] to own a [[#shared.file|file]] and vice versa.
==== django_content_type ====


{| class="wikitable"  
A Django table for content types.
|+ Columns in "protected_area_data_object_file"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| data_object_id || integer || NO || A reference to the [[#rca.data_object|data object]].
| app_label
|  
|-
|-
| file_id || integer || NO || A reference to the [[#shared.file|file]].
| model
|  
|}
|}


<span id="pa.rca"></span>
<span id="public.django_migrations"></span>
=== Table: rca ===


Stores basic information about RCAs along with a boundary geometry.
==== django_migrations ====


{| class="wikitable"  
Records migrations applied to database.
|+ Columns in "rca"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| area || real || YES || The area of the RCA (from source).
| app
|  
|-
|-
| description || text || YES || A description of the RCA.
| name
|  
|-
|-
| formerid || smallint || YES || The former ID of the RCA (from source).
| applied
|-
|  
| geom || geometry || YES || The RCA geography.
|-
| hectares || real || YES || The number of hectares in the RCA (from source).
|-
| len || real || YES || The length (?) of the RCA (from source).
|-
| name || character varying || YES || The name of the RCA.
|-
| rca_id || double precision || YES || The RCA ID as defined by the provider.
|-
| sq_km || real || YES || The area of the RCA (from source).
|-
| yr_created || smallint || YES || The year the RCA was created (from source).
|}
|}


<span id="rov"></span>
<span id="public.django_session"></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>
==== django_session ====
=== Table: abundance ===


Stores a list of abundance labels from the ACFOR scale.
Django session management.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "abundance"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| session_key
|
|-
|-
| name || character varying || NO || A descriptive label for the abundance level.
| session_data
|  
|-
|-
| note || text || YES || An optional note about the abundance level.
| expire_date
|  
|}
 
<span id="public.django_site"></span>
 
==== django_site ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| 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.
| id
|  
|-
|-
| 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.
| domain
|  
|-
|-
| 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.
| name
|  
|}
|}


<span id="rov.annotation_protocol"></span>
<span id="public.event_group"></span>
=== 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.
==== event_group ====


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "annotation_protocol"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| event_id
|
|-
|-
| algae_species || character varying || YES || Whether all algae species are identified: "all", "subset" or "none".
| group_id
|  
|}
 
<span id="public.knox_authtoken"></span>
 
==== knox_authtoken ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| annotation_software_id || integer || NO || Software used to annotate the video or images. Looked up in the [[#rov.annotation_software|annotation software]] table.
| digest
|  
|-
|-
| biogenic_habitat || boolean || YES || True if any habitat categories include fauna (e.g., sponge reefs).
| created
|  
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| user_id
|  
|-
|-
| creator_id || integer || YES || Records the identity of the person who created this protocol.
| expiry
|  
|-
|-
| fish_species || character varying || YES || Whether all fish species are identified: "all", "subset" or "none".
| token_key
|  
|}
 
<span id="public.spatial_ref_sys"></span>
 
==== spatial_ref_sys ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| fov_interval || real || YES || [None]
| srid
|  
|-
|-
| fov_interval_unit || character varying || NO || A unit for the field of view interval, such as 's' for seconds or 'm' for metres.
| auth_name
|  
|-
|-
| habitat_interval || real || YES || [None]
| auth_srid
|  
|-
|-
| habitat_interval_unit || character varying || NO || A unit for the habitat interval, such as 's' for seconds or 'm' for metres.
| srtext
|  
|-
|-
| habitat_only || boolean || YES || Set to true if only habitat variables were recorded.
| proj4text
|  
|}
 
<span id="public.thumbnail_kvstore"></span>
 
==== thumbnail_kvstore ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| image_interval || real || YES || The interval between images or frame grabs. Typically 3 to 10 seconds.
| key
|  
|-
|-
| image_interval_unit || character varying || NO || A unit for the image interval, such as 's' for seconds or 'm' for metres.
| value
|-
|  
| 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".
 
|-
=== Views ===
| is_template || boolean || NO || If this is meant to be a template that is copied for use, mark this column `true`.
 
|-
<span id="public.geography_columns"></span>
| medium_type_id || integer || NO || The type of media used for annotation. Looked up in [[#rov.medium_type|media type]] table.
 
==== geography_columns ====
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| name || character varying || NO || The name of the annotation protocol. Should be unique.
| f_table_catalog
|  
|-
|-
| 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.
| f_table_schema
|  
|-
|-
| observation_interval || real || YES || [None]
| f_table_name
|  
|-
|-
| observation_interval_unit || character varying || NO || A unit for the observation interval, such as 's' for seconds or 'm' for metres.
| f_geography_column
|  
|-
|-
| protocol_document || character varying || YES || Link, title, DOI, etc. of a document describing the protocol in full.
| coord_dimension
|  
|-
|-
| species_guide || character varying || YES || A URL to the iNaturalist species guide that was used for annotation.
| srid
|  
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
| type
|  
|}
|}


<span id="rov.annotation_protocol_document"></span>
<span id="public.geometry_columns"></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.
==== geometry_columns ====


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "annotation_protocol_document"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| f_table_catalog
|
|-
|-
| annotation_protocol_id || integer || NO || A reference to the [[#rov.annotation_protocol|annotation protocol]].
| f_table_schema
|  
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
| f_table_name
|  
|-
|-
| file_name || character varying || YES || The original name of the document file.
| f_geometry_column
|  
|-
|-
| 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.
| coord_dimension
|  
|-
|-
| note || text || YES || An optional note about the document.
| srid
|  
|-
|-
| title || character varying || NO || The title of the document.
| type
|-
|  
| 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>
=== Table: annotation_software ===


The software used for annotation.
=== Functions ===
 
;get_restricted_events
:Return the [[#rov.event|events]] that are either unrestricted, or subject to [[#shared.restriction|restrictions]] for which at least one of the user's [[#public.auth_group|groups]] is permitted.
;restriction_group_set_admin
:When a [[#shared.restriction|restriction]] is inserted, automatically inserts a record into [[#shared.restriction|restriction_group]] group to give admins permission to see the restricted record. Other groups can be added manualy.
;trigger_compile_event_restriction_masks
:Triggers compilation of [[#shared.restriction|restriction]] masks on the [[#rov.event|event]] table when it is updated.
;updated_on_column
:Updates the updated_on column of a relation to the current time on update.
 
=== Procedures ===
 
;cache_clear_cruise
:Clear cached entities associated with the given cruise.
;cache_refresh_cruise_stats
:Refresh the [[#cache.cruise_stats|cruise stats]] table.
;cache_refresh_cruise_track
:Stores a linestring representing the path of a platform over the course of a cruise.
;cache_refresh_dive_track
:Stores a linestring representing the path of a platform over the course of a dive.
;cache_refresh_evt_depth
:Populates the cache table with depths corresponding to each event. For events that cover a time span, the timestamp and position will be stored as multiple ordered values in the array. For events without an end time a single element will be contained in the array. The boolean parameter, if true truncates the table before rebuilding it.
;cache_refresh_evt_measurement
:Populates the cache table with measurements corresponding to each event. For events that cover a time span, the timestamp and measurement will be stored as multiple ordered values in the array. For events without an end time a single element will be contained in the array. The boolean parameter, if true
;cache_refresh_evt_pos
:Populates the cache table with depths corresponding to each event. For events that cover a time span, the timestamp and position will be stored as multiple ordered values in the array. For events without an end time a single element will be contained in the array. If the boolean parameter is true, the table is truncated before rebuilding.
;cache_refresh_tables
:Calls the cache refresh procedures stored in the [[#admin.cache_table|cache_table]] table. These procedures refresh or rebuild cache tables and other tables that need periodic compilation. Each procedure called by this procedure must have a boolean parameter to do with as it chooses. In most cases, the parameter clears or truncates the target table.
;cache_refresh_tables
:Refreshes all of the cache tables: event positions, event depths, event measurements, dive tracks, transect tracks and cruise tracks.
;cache_refresh_transect_track
:Stores a linestring representing the path of a platform over the course of a transect.
;clean_event_duplicates
:Deletes duplicate [[#rov.event|events]] over all cruises.
;clean_event_duplicates
:Deletes duplicate [[#rov.event|events]] for the given cruise by checking their time stamps, properties, [[#rov.instrument_config|instrument configs]] and dive IDs. Loops multiple times to capture multiple duplicates. Deletes duplicate measurements in a separate loop, looking at the type, timestamps, instrument configs and quantity.
;clean_measurement_event_duplicates
:Deletes duplicate [[#rov.event|measurment events]] for a specific [[#rov.cruise|cruise]].
;clean_uploaded_files
:Removes [[#shared.uploaded_file|uploaded file]] instances that are not referenced by any other entity. A server-side script must run which deletes files with no corresponding uploaded file record.
;compile_event_restrictions
:Compiles the [[#rov.event_group|event group]] table which links events to the [[#public.auth_user|users]] whose [[#public.auth_group|groups]] has access to the record based on [[#shared.restriction|restriction]] table
;remove_duplicates
:Removes duplicated [[#rov.position|positions]], [[#rov.measurement|measurements]] and [[#rov.event|events]] (not observations which cannot be deduplicated deterministically).
;update_biigle_fov
:Finds status events indicating a Laser Point and computes the laser distance in pixels and field of view in centimetres using the annotation points. Creates measurement events and deletes the status events.
 
<span id="{schema}"></span>
 
== Schema: rov ==
 
Contains tables related to the imagery annotation (ROV) database.
 
=== Tables ===
 
<span id="rov.abundance"></span>
 
==== abundance ====
 
Stores a list of abundance labels from the ACFOR scale.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "annotation_software"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| name || character varying || NO || The name of the annotation software.
| name
| A descriptive label for the abundance level.
|-
|-
| note || text || YES || An optional note about the annotation software.
| rank
| 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 || NO || Provides a short code for looking up the entity.
| source
| A source label to distinguish abundance labels with the same names. TODO: Provisional, pending determination of how abundance codes are handled.
|-
| note
| An optional note about the abundance level.
|-
| short_code
| Contains a short code that can be used to look up an abundance (e.g., during import) without relying on the primary key.
|}
|}


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


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.
Stores information about the annotation projects that generate information from photo and video media.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "biocover"
! Column
! Comment
|-
| id
|
|-
| name
| A name for the annotation project.
|-
| objective
| A statement of the objectives of the annotation project.
|-
| note
| Operational notes about the annotation project.
|-
|-
! Name !! Type !! Nullable !! Documentation
| start_date
| The starting date of the project.
|-
|-
| name || character varying || NO || The name of the biocover.
| end_date
| The ending date of the project.
|-
|-
| note || text || YES || An optional description of the biocover.
| created_on
| The date of creation of the entity.
|-
|-
| 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.
| updated_on
| The date of last modification of the entity.
|}
|}


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


Provides a way to record comments rather than using a sparse note field on the [[#rov.table|event]].
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 "comment_event"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| event_id || integer || NO || A reference to the [[#rov.event|parent event]].
| annotation_job_id
| The ID of the [[#rov.annotation_job|annotation job]].
|-
|-
| note || text || YES || A text comment or note.
| annotation_protocol_id
| The ID of the [[#rov.annotation_protocol|annotation protocol]].
|}
|}


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


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.
Associates crew members with an [[#rov.annotation_job|annotation job]] with their respective [[#rov.annotation_job_role|roles]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "complexity"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| name || character varying || NO || The name of the complexity type.
| annotation_job_id
| The ID of the [[#rov.annotation_job|annotation job]].
|-
|-
| note || text || YES || An optional description of the complexity type.
| person_id
| The ID of the [[#shared.person|crew member]].
|-
|-
| 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.
| role_id
| The ID of the [[#rov.annotation_job_role|role]].
|}
|}


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


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.
Stores the possible roles one can perform on an [[#rov.annotation_job|annotation job]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "coverage"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| maximum || real || NO || The minimum value in the range.
| name
| The name of the role.
|-
|-
| minimum || real || NO || The minimum value in the range.
| note
|-
| A descript of the role.
| 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.
<span id="rov.annotation_protocol"></span>
|-
| 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.
|}


<span id="rov.cruise"></span>
==== annotation_protocol ====
=== 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.
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 "cruise"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| 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.
| medium_type_id
| The type of media used for annotation. Looked up in [[#rov.medium_type|media type]] table.  
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| annotation_software_id
| Software used to annotate the video or images. Looked up in the [[#rov.annotation_software|annotation software]] table.
|-
|-
| end_time || timestamp without time zone || YES || The end time of the leg.
| name
| The name of the annotation protocol. Should be unique.
|-
|-
| leg || integer || NO || Cruise legs are numbered from 1.
| is_template
| If this is meant to be a template that is copied for use, mark this column `true`.
|-
|-
| name || character varying || NO || A name for this leg of the cruise.
| image_interval
| The interval between images or frame grabs. Typically 3 to 10 seconds.
|-
|-
| note || text || YES || Notes about the cruise.
| image_overlap
| Is there overlap between the images (true) or do they represent independent non-overlapping space (false).
|-
|-
| objective || text || YES || A statement of the operational or scientific objectives of the cruise.
| habitat_only
| Set to true if only habitat variables were recorded.
|-
|-
| planned_track || USER-DEFINED || YES || A multilinestring containing the planned track of the leg. TODO: Not known whether this is necessary.
| species_guide
| A URL to the iNaturalist species guide that was used for annotation.
|-
|-
| ship_id || integer || NO || [None]
| note
| 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.
|-
|-
| start_time || timestamp without time zone || NO || The start time of the leg.
| created_on
| The date of creation of this record.
|-
|-
| summary || text || YES || A summary of the cruise, with information about whether the objectives were met and any other pertinent information.
| updated_on
| The date of update of this record.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
| creator_id
|}
| Records the identity of the person who created this protocol.
 
<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"
|-
|-
! Name !! Type !! Nullable !! Documentation
| invertebrate_species
| Whether all invertebrate species are identified: "all", "subset" or "none".
|-
|-
| cruise_id || integer || NO || Reference to the [[#rov.cruise_leg|cruise leg]] to which the member is assigned.
| fish_species
| Whether all fish species are identified: "all", "subset" or "none".
|-
|-
| cruise_role_id || integer || NO || Reference to the [[#rov.cruise_role|cruise role]].
| algae_species
| Whether all algae species are identified: "all", "subset" or "none".
|-
|-
| note || text || YES || An optional note about the crew member.
| biogenic_habitat
| True if any habitat categories include fauna (e.g., sponge reefs).
|-
|-
| person_id || integer || NO || Reference to the [[#rov.person|person]] on the crew.
| protocol_document
|}
| Link, title, DOI, etc. of a document describing the protocol in full.
 
<span id="rov.cruise_document"></span>
=== Table: cruise_document ===
 
None
 
{| class="wikitable"
|+ Columns in "cruise_document"
|-
! Name !! Type !! Nullable !! Documentation
|-
|-
| created_on || timestamp without time zone || NO || [None]
| observation_interval
| The time interval between species or anthropogenic observations.
|-
|-
| cruise_id || integer || NO || [None]
| habitat_interval
| The time interval between habitat observations.
|-
|-
| file_name || character varying || YES || [None]
| fov_interval
| The time interval between field-of-view measurements.
|-
|-
| file_type || character varying || YES || [None]
| image_interval_unit
| A unit for the image interval, such as 's' for seconds or 'm' for metres.
|-
|-
| note || text || YES || [None]
| observation_interval_unit
| A unit for the observation interval, such as 's' for seconds or 'm' for metres.
|-
|-
| title || character varying || NO || [None]
| habitat_interval_unit
| A unit for the habitat interval, such as 's' for seconds or 'm' for metres.
|-
|-
| updated_on || timestamp without time zone || NO || [None]
| fov_interval_unit
|-
| A unit for the field of view interval, such as 's' for seconds or 'm' for metres.
| url || character varying || YES || [None]
|}
|}


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


A table for associating First Nations contacts with a cruise.
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"  
:: {| class="wikitable"
|+ Columns in "cruise_fn_contact"
! Column
! Comment
|-
| id
|  
|-
|-
! Name !! Type !! Nullable !! Documentation
| annotation_protocol_id
| A reference to the [[#rov.annotation_protocol|annotation protocol]].
|-
|-
| contact_name || character varying || NO || The full name of the contact.
| note
| An optional note about the document.
|-
|-
| cruise_id || integer || NO || A reference to the [[#rov.cruise|cruise]].
| title
| The title of the document.
|-
|-
| email || character varying || YES || The email address of the contact.
| url
| An optional URL for the document. If file data are not given, this field is required.
|-
|-
| nation || text || YES || The name of the nation or group represented by the contact.
| created_on
| The time of creation of the record.
|-
|-
| note || text || YES || A note about the contact.
| updated_on
| The time of update of the record.
|-
|-
| phone || character varying || YES || The phone number of the contact.
| file_id
| A reference to the [[#shared.uploaded_file|uploaded file]].
|}
|}


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


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.
==== annotation_software ====


{| class="wikitable"  
The software used for annotation.
|+ Columns in "cruise_library"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| cruiseleg_id || integer || NO || A reference to the [[#rov.cruise_leg|cruise leg]].
| name
| The name of the annotation software.
|-
|-
| library_id || integer || NO || A reference to the document in the [[#rov.library|library]].
| note
|-
| An optional note about the annotation software.
| 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>
<span id="rov.biigle_label_map"></span>
=== Table: cruise_program ===
 
==== biigle_label_map ====


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.
Contains mappings from Biigle labels to properties that apply to events.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "cruise_program"
! Column
! Comment
|-
| id
|
|-
| label_tree_id
| The ID of the Biigle label tree.
|-
| label_id
| The ID of the Biigle label.
|-
| label_hierarchy
| The full hierarchical text of the Biigle label.
|-
|-
! Name !! Type !! Nullable !! Documentation
| label_text
| The text of the final element of the label.
|-
|-
| cruise_id || integer || NO || The ID of a [[#rov.cruise|cruise]].
| properties
| Stores the properties of the observation.
|-
|-
| program_id || integer || NO || The ID of a [[#rov.program|program]].
| note
| A textual note or comment.
|-
| created_on
| The time of creation of the record.
|-
| updated_on
| Time of last update of the record.
|}
|}


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


A lookup table of roles available to members of [[#rov.cruise_leg_crew|cruise leg crews]].
Links a [[#rov.biigle_label_map|Biigle label map]] to a [restriction][#shared.restriction].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "cruise_role"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| name || character varying || NO || The name of the role.
| restriction_id
| A link to the [[#shared.restriction|restriction]].
|-
|-
| note || text || YES || An optional note about the role and its responsibilities.
| biigle_label_map_id
|-
| A link to the [[#rov.biigle_label_map|label map]].
| short_code || character varying || NO || [None]
|}
|}


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


Provides a nominal level of disturbance for [[#rov.habitat_event|habitat events]].
A lookup table listing the available biocover types for the [[#rov.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 [[#taxonomy.taxon|taxon]] table.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "disturbance"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| name || character varying || NO || The textual representation of the disturbance level.
| name
| The name of the biocover.
|-
|-
| note || text || YES || A note about the disturbance level.
| note
| An optional description of the biocover.
|-
|-
| 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.
| short_code
| 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.dive"></span>
<span id="rov.complexity"></span>
=== Table: dive ===
 
==== complexity ====


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 lookup table listing the available habitat complexity types for the [[#rov.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 "dive"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| attributes || jsonb || YES || A JSON column used for recording structured attributes that do not fit with the regular table structure.
| name
| The name of the complexity type.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| note
| An optional description of the complexity type.
|-
|-
| cruise_id || integer || NO || A reference to the [[#rov.cruise_leg|cruise leg]] during which the dive was performed.
| short_code
| Contains a short code that can be used to look up a complexity (e.g., during import) without relying on the primary key.
|}
 
<span id="rov.coverage"></span>
 
==== coverage ====
 
A lookup table listing the percentage of coverage for the [[#rov.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"
! Column
! Comment
|-
|-
| end_time || timestamp without time zone || NO || The end of the dive.
| id
|  
|-
|-
| name || character varying || NO || A name for the dive.
| name
| A characterization of percent coverage. Presented as a range of percentages.
|-
|-
| note || text || YES || An optional note about the dive.
| minimum
| The minimum value in the range.
|-
|-
| objective || text || YES || A statement of the practical or research objectives for this dive.
| maximum
| The minimum value in the range.
|-
|-
| ship_config_id || integer || NO || A reference to the [[#rov.platform_config|platform config]] for the ship.
| note
| An optional note about the coverage percentage.
|-
|-
| site_id || integer || YES || Optional reference to the geographic [[#rov.site|site]] of the dive.
| short_code
|-
| Contains a short code that can be used to look up a coverage (e.g., during import) without relying on the primary key.
| 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.cruise"></span>
=== Table: dive_crew ===
 
==== cruise ====


Assigns roles to dive crew members. Crew members are selected from the [[#rov.person|person]].
Cruise legs occur within a [[#rov.cruise|cruise]] and are assigned specific [[#rov.cruise_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"  
:: {| class="wikitable"
|+ Columns in "dive_crew"
! Column
! Comment
|-
| id
|
|-
| name
| A name for this leg of the cruise.
|-
| objective
| A statement of the operational or scientific objectives of the cruise.
|-
| start_time
| The start time of the leg.
|-
|-
! Name !! Type !! Nullable !! Documentation
| end_time
| The end time of the leg.
|-
|-
| dive_id || integer || NO || The [[#rov.dive|dive]] to which the crew member is assigned.
| planned_track
| A multilinestring containing the planned track of the leg. TODO: Not known whether this is necessary.
|-
|-
| dive_role_id || integer || NO || A reference to the [[#rov.dive_role|dive role]].
| note
| Notes about the cruise.
|-
|-
| note || text || YES || An optional note about the crew member.
| created_on
| The date of creation of this record.
|-
|-
| person_id || integer || NO || A reference to the [[#rov.person|person]].
| updated_on
|}
| The date of update of this record.
 
|-
<span id="rov.dive_role"></span>
| leg
=== Table: dive_role ===
| Cruise legs are numbered from 1.
 
|-
A list of roles available to crew members on a [[#rov.dive|dive]] via the [[#rov.dive_crew|dive_crew]] table.
| summary
 
| A summary of the cruise, with information about whether the objectives were met and any other pertinent information.
{| class="wikitable"
|+ Columns in "dive_role"
|-
|-
! Name !! Type !! Nullable !! Documentation
| approved
| 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.
|-
|-
| name || character varying || NO || The name of the role.
| ship_id
| The ID of the [[#rov.platform|ship]] used on this cruise.
|-
|-
| note || text || YES || An optional description of the role.
| admin_note
| Notes by the database administrator about this entity.
|-
|-
| short_code || character varying || NO || [None]
| mark_for_delete
| Marks the entity for asynchronous deletion by the runner.
|}
|}


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


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.
Associates [[#shared.person|crew members]] with a [[#rov.cruise|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"  
:: {| class="wikitable"
|+ Columns in "equipment_type"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| category || USER-DEFINED || YES || An enumeration column identifying the equipment as platform, instrument or some other type.
| cruise_id
| Reference to the [[#rov.cruise|cruise leg]] to which the member is assigned.
|-
|-
| name || character varying || NO || A name for the equipment type.
| person_id
| Reference to the [[#shared.person|person]] on the crew.
|-
|-
| note || text || YES || An optional note about the equipment type.
| cruise_role_id
| Reference to the [[#rov.cruise_role|cruise role]].
|-
|-
| short_code || character varying || NO || A short code for referencing the equipment type in import documents.
| note
| An optional note about the crew member.
|}
|}


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


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.
Stores information about documents related to a [[#rov.cruise|cruise]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "event"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| attributes || jsonb || YES || [None]
| cruise_id
| The ID of the [[#rov.cruise|cruise]].
|-
|-
| created_on || timestamp without time zone || NO || The time of creation of this record.
| note
| A note about the document.
|-
|-
| dive_id || integer || NO || A reference to a [[#rov.dive|dive]].
| title
| The title of the document.
|-
|-
| end_time || timestamp without time zone || YES || The end time of the event. If the event is instantaneous, this field is null.
| url
| A URL for the online copy of the document. May be used when no file is available.
|-
|-
| frames || jsonb || YES || Preserves the frames from the Biigle annotation.
| created_on
| The date and time of creation of the entity.
|-
|-
| medium_filename || character varying || YES || The name of the media file from which this event is derived.
| updated_on
| The date and time of the entity's last update.
|-
|-
| medium_id || integer || YES || A reference to the [[#rov.medium|medium]] on which this annotation was created.
| file_id
|  
|}
 
<span id="rov.cruise_fn_contact"></span>
 
==== cruise_fn_contact ====
 
A table for associating First Nations contacts with a cruise.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| original_id || integer || NO || The original ID of the event if read from a source that has IDs.
| id
|  
|-
|-
| original_labels || jsonb || YES || Optionally stores information about annotation labels used to generate this event. For Biigle, stores the label IDs.
| cruise_id
| A reference to the [[#rov.cruise|cruise]].
|-
|-
| 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.
| contact_name
| The full name of the contact.
|-
|-
| shape_area || double precision || YES || The area of the shape in square metres, calculated from the screenand shape dimensions and the laser point distance.
| email
| The email address of the contact.
|-
|-
| 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.
| phone
| The phone number of the contact.
|-
|-
| tags || jsonb || YES || Stores a list of tags relevant to this event.
| nation
| The name of the nation or group represented by the contact.
|-
|-
| transect_id || integer || YES || An optional reference to a [[#rov.transect|transect]]. TODO: Clarify the use of transects and whether this column is nullable.
| note
| A note about the contact.
|}
|}


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


This table tracks the [[#shared.person|people]] who contributed to annotation, which may be composed of a number of separate labels.
==== cruise_import ====
 
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 "event_logger"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| event_id || integer || NO || The [[#rov.event|event]] that was created from the annotation(s).
| name
| A unique name for the import job.
|-
|-
| person_id || integer || NO || A [[#shared.person|person]] who contributed to the annotation.
| data
|}
| A JSON document containing the cruise import data.
 
<span id="rov.habitat_event"></span>
=== Table: habitat_event ===
 
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.
 
{| class="wikitable"
|+ Columns in "habitat_event"
|-
|-
! Name !! Type !! Nullable !! Documentation
| status
| A status message about processing.
|-
|-
| annotation_protocol_id || integer || NO || A reference to the [[#rov.annotation_protocol|annotation protocol]] used in the creation of this observation.
| logs
| A JSON array containing the complete processing log.
|-
|-
| biocover_coverage_id || integer || YES || A [[#rov.coverage|coverage]] value for the [[#rov.biocover|biocover]].
| created_on
|  
|-
|-
| biocover_id || integer || YES || A reference to the [[#rov.biocover|biocover]] lookup.
| updated_on
|  
|-
|-
| complexity_id || integer || YES || A reference to the [[#rov.complexity|habitat complexity]] lookup.
| version
|  
|-
|-
| disturbance_id || integer || YES || Indicates the level of disturbance of the substrate and/or biota.
| task_id
| Stores the task ID for the asychrnonous task (i.e., a Celery task) used to process the import.
|}
 
<span id="rov.cruise_program"></span>
 
==== 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"
! Column
! Comment
|-
|-
| event_id || integer || NO || A reference to the parent [[#rov.event|event]].
| id
|  
|-
|-
| relief_id || integer || YES || A reference to the [[#rov.relief|relief]] level.
| cruise_id
| The ID of a [[#rov.cruise|cruise]].
|-
|-
| substrate_coverage_id || integer || YES || A [[#rov.coverage|coverage]] value for the [[#rov.substrate|substrate]].
| program_id
| The ID of a [[#rov.program|program]].
|}
 
<span id="rov.cruise_role"></span>
 
==== cruise_role ====
 
A lookup table of roles available to members of [[#rov.cruise_crew|cruise leg crews]].
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| substrate_id || integer || YES || A reference to the dominant [[#rov.substrate|substrate]] lookup.
| id
|  
|-
|-
| taxon_id || integer || YES || A reference to the [[#shared.taxon|taxon]] used in the creation of this observation.
| name
| The name of the role.
|-
|-
| thickness_id || integer || YES || A reference to the [[#rov.thickness|biocover thickness]] lookup.
| note
| An optional note about the role and its responsibilities.
|-
| short_code
| A short string used to identify the role.
|}
|}


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


Nominal image quality levels, originally used by VideoMiner but applicable to new records.
Provides a nominal level of disturbance for [[#rov.event|habitat events]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "image_quality"
! Column
|-
! Comment
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || A name for the quality level.
| id
|  
|-
|-
| note || text || YES || An optional note.
| name
| The textual representation of the disturbance level.
|-
|-
| rank || integer || YES || An ordinal rank (zero is high) for the quality level.
| note
| A note about the disturbance level.
|-
|-
| 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.
| short_code
| 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.import_queue_annotator"></span>
<span id="rov.dive"></span>
=== Table: import_queue_annotator ===


Stores the import packages created by annotators.
==== dive ====


{| class="wikitable"  
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.
|+ Columns in "import_queue_annotator"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of the record.
| cruise_id
| A reference to the [[#rov.cruise|cruise leg]] during which the dive was performed.
|-
|-
| 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.
| name
| A name for the dive.
|-
|-
| data || jsonb || NO || Stores the JSON representation of the import job.
| objective
| A statement of the practical or research objectives for this dive.
|-
|-
| mseauser_id || integer || NO || A reference to the [[#shared.mseauser|MSEA user]] that created the record.
| start_time
| The start of the dive. Not necessarily the time the vehicle is placed in the water.
|-
|-
| name || character varying || NO || A unique name for the import queue record.
| end_time
| The end of the dive.
|-
|-
| note || text || YES || An optional note about the import package.
| note
| An optional note about the dive.
|-
|-
| status || character varying || YES || A short description of the processing status of the job.
| attributes
| A JSON column used for recording structured attributes that do not fit with the regular table structure.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of the record.
| created_on
| The date of creation of this record.
|-
| updated_on
| The date of update of this record.
|-
| summary
| A summary of the [[#rov.dive|dive]]; whether objectives were met, problems encountered, etc.
|-
| sub_config_id
| A reference to the [[#rov.platform_config|platform config]] for the submersible or ROV.
|-
| ship_config_id
| A reference to the [[#rov.platform_config|platform config]] for the ship.
|-
| admin_note
|
|-
| seatube_id
| The ID of a dive on SeaTube corresponding to this dive.
|-
| mark_for_delete
| Marks the entity for asynchronous deletion by the runner.
|-
| site
| An optional name for the site.
|}
|}


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


A table to store the last configured tags and values for labels. Provides pre-filling in label mapping application.
Assigns roles to dive crew members. Crew members are selected from the [[#shared.person|person]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "import_queue_annotator_label_map_prefill"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| created_on || timestamp without time zone || YES || [None]
| dive_id
| The [[#rov.dive|dive]] to which the crew member is assigned.
|-
|-
| label_tree_name || character varying || YES || The label tree name. If given identifies the label uniquely with the tree name.
| person_id
| A reference to the [[#shared.person|person]].
|-
|-
| name || character varying || NO || The text of the label.
| dive_role_id
| A reference to the [[#rov.dive_role|dive role]].
|-
|-
| tag_data || jsonb || NO || The the tag data.
| note
|-
| An optional note about the crew member.
| 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.dive_role"></span>
=== Table: import_queue_pi ===
 
==== dive_role ====


Stores the import packages created by principal investigators.
A list of roles available to crew members on a [[#rov.dive|dive]] via the [[#rov.dive_crew|dive_crew]] table.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "import_queue_pi"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of the record.
| name
| The name of the role.
|-
|-
| cruise_id || integer || NO || A reference to the [[#rov.cruise|cruise]].
| note
| An optional description of the role.
|-
|-
| mseauser_id || integer || NO || A reference to the [[#shared.mseauser|MSEA user]] that created the record.
| short_code
| A short string used to identify the role.
|}
 
<span id="rov.equipment_type"></span>
 
==== equipment_type ====
 
This is a lookup table to provide the names of types of equipment for the [[#rov.model|model]] table, e.g., "Digital Still Camera", "Thermometer," "ROV," etc.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| name || character varying || NO || A name of the import job
| id
|  
|-
|-
| note || text || YES || An optional note about the import package.
| name
| A name for the equipment type.
|-
|-
| status || character varying || YES || A short description of the processing status of the job.
| note
| An optional note about the equipment type.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of the record.
| category
| An enumeration column identifying the equipment as platform, instrument or some other type.
|}
|}


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


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]].
The event table, a schemaless table storing all recorded observations and statuses during operations.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "instrument"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| attributes || jsonb || YES || A freeform list of attributes for this instrument.
| dive_id
| A reference to the dive during which this event occurred.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| annotation_job_id
|  
|-
|-
| model_id || integer || NO || A reference to the instrument [[#rov.model|model]].
| instrument_config_id
|  
|-
|-
| note || text || YES || An optional note about this instrument.
| start_time
| The start time of the event.
|-
|-
| organisation_id || integer || NO || A reference to the organisation that owns and operates the instrument.
| end_time
| The end time of the event. Null, if the event is discrete.
|-
|-
| retired || date || YES || If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active.
| properties
| A JSON object containing name-value pairs describing the event.
|-
|-
| 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.
| note
| An optional note about the event. Do not use to store event data.
|-
|-
| 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.
| created_on
| The time of creation of the event.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
| updated_on
| The time of update of the event. Automatically updated by a trigger.
|-
| hidden
| If true, the entity should be hidden from searches and reports. An alternative to deleting entities that may prove useful in the future.
|-
| import_group_id
| A reference to the [[#rov.import_group|import group]], which tracks events which were imported at the same time, from the same file.
|}
|}


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


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.
Links the [[#rov.event|event]] table to the [[#public.auth_group|group]] table to facilitate the [[#shared.restriction|restriction]] mechanism.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "instrument_config"
! Column
|-
! Comment
! 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.
| event_id
| Links to the [[#rov.event|event]] table.
|-
|-
| instrument_id || integer || NO || Reference to the [[#rov.instrument|instrument]] targeted by the configuration.
| group_id
|-
| Links to the [[#public.auth_group|group]] table.
| name || character varying || NO || The name of the instrument config. Need not be unique: used to identify the config within the platform config.
|-
| 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>
<span id="rov.event_logger"></span>
=== Table: measurement ===
 
==== event_logger ====


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.
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 "measurement"
! Column
|-
! Comment
! Name !! Type !! Nullable !! Documentation
|-
| 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.
| id
|  
|-
|-
| measurement_type_id || integer || NO || A reference to the [[#rov.measurement_type|type]] of this measurement.
| person_id
| A [[#shared.person|person]] who contributed to the annotation.
|-
|-
| quantity || real || NO || The scalar quantity or magnitude of the measurement.
| event_id
|-
| The [[#rov.event|event]] that was created from the annotation(s).
| 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.flow"></span>
=== Table: measurement_event ===


A table for storing human-created measurements.
==== flow ====


{| class="wikitable"  
Stores categories of current flow for [[#rov.event|habitat]].
|+ Columns in "measurement_event"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| event_id || integer || NO || A reference to the parent [[#rov.event|event]].
| name
| A note about the flow category.
|-
|-
| measurement_type_id || integer || NO || A reference to the [[#rov.measurement_type|measurement type]].
| note
|  
|-
|-
| quantity || real || NO || The measurement value in the [[#rov.measurement_type|measurement type]] unit.
| short_code
| A short code for the flow category.
|}
|}


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


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.
A table for storing mappings from annotation labels to property sets.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "measurement_type"
! Column
|-
! Comment
! Name !! Type !! Nullable !! Documentation
|-
|-
| maximum || real || YES || An optional upper bound on the value of the measurement. Null implies no limit.
| id
|  
|-
|-
| minimum || real || YES || An optional lower bound on the value of the measurement. Null implies no limit.
| label_text
| The text of the label.
|-
|-
| name || character varying || NO || The type of measurement. E.g., "Density" or "Salinity."
| properties
| A dictionary of mapped properties.
|-
|-
| note || text || YES || An optional note about this measurement type.
| note
| A note about the mapping.
|-
|-
| 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.
| created_on
| The date of creation.
|-
|-
| 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.
| updated_on
| The date of last update.
|}
|}


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


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.
Links a [[#rov.generic_label_map|generic label mapping]] to a [[#shared.restriction|restriction]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "medium"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| biigle_video_id || integer || YES || Provisional: the ID of the video as represented in [https://biigle.de Biigle.de].
| restriction_id
| A reference to a [[#shared.restriction|restriction]].
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| generic_label_map_id
|-
| A reference to a [[#rov.generic_label_map|generic label mapping]].
| file_id || integer || NO || A required reference to the [[#shared.file|file]].
|}
 
<span id="rov.image_quality"></span>
 
==== image_quality ====
 
Nominal image quality levels, originally used by VideoMiner but applicable to new records.
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| 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.
| id
|  
|-
|-
| height || integer || YES || The height of the video frame in pixels.
| name
| A name for the quality level.
|-
|-
| instrument_config_id || integer || NO || An [[#rov.instrument_config|instrument configuration]] for the instrument that generated this media.
| rank
| An ordinal rank (zero is high) for the quality level.
|-
|-
| length || real || YES || If a video or acoustic file (etc.), the length in seconds.
| note
| An optional note.
|-
|-
| medium_format_id || integer || YES || A reference to the [[#rov.medium_format|format]] of the data.
| short_code
|-
| Contains a short code that can be used to look up an image quality (e.g., during import) without relying on the primary key.
| note || text || YES || An optional note about this data.
|}
 
<span id="rov.import_group"></span>
 
==== import_group ====
 
Stores information about a group of [[#rov.measurement|measurements]], [[#rov.position|positions]] or [[#rov.event|events]] so they can be distinguished by when or from what file they were imported. This provides the ability to delete a single stream of data at a finer resolution that just the [[#rov.instrument_config|instrument config]], [[#rov.platform_config|platform config]], [[#rov.dive|dive]], etc. The initial entries in the table are created retroactively, and contain undifferentiated records based on the instrument config and measurement type (measurements); the instrument config (positions) or the dive and instrument config (events).
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| parent_id || integer || YES || If the video or photo is derived or cropped from another, this refers to the source record (optional).
| id
|  
|-
|-
| 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.
| name
| A name for the import or the name of the file from which the data were imported.
|-
|-
| start_time || timestamp without time zone || NO || The start date/time of this video, or the instantaneous time if it's a photograph.
| note
|  
|-
|-
| thumbnail || bytea || YES || An optional thumbnail to represent the stored medium.
| created_on
| The date and time that the import was initiated.
|-
|-
| width || integer || YES || The width of the video frame in pixels.
| source_file
|  
|}
|}


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


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.
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 "medium_format"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| 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.
| user_id
| A reference to the [[#shared.mseauser|MSEA user]] that created the record.
|-
|-
| medium_type_id || integer || NO || A reference to the [[#rov.medium_type|medium type]] (e.g., video or photo).
| note
| An optional note about the import package.
|-
|-
| name || character varying || NO || The name of the format.
| created_on
| The date of creation of the record.
|-
|-
| note || text || YES || An optional note about the format.
| updated_on
| The date of update of the record.
|-
|-
| 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.
| name
|}
| A unique name for the import queue record.
 
|-
<span id="rov.medium_type"></span>
| status
=== Table: medium_type ===
| A short description of the processing status of the job.
 
|-
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.
| cruise_name
 
| 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.
{| class="wikitable"
|-
|+ Columns in "medium_type"
| data
| Stores the JSON representation of the import job.
|-
|-
! Name !! Type !! Nullable !! Documentation
| hidden
|
|-
|-
| name || character varying || NO || The name of the media type.
| objective
|  
|-
|-
| note || text || YES || An optional note about the media type.
| start_date
|  
|-
|-
| short_code || character || NO || Provides a short code for looking up the entity.
| end_date
|  
|}
|}


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


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 table to store the last configured tags and values for labels. Provides pre-filling in label mapping application.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "model"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| attributes || jsonb || YES || A free-form JSON field for attributes of this model.
| tags
| The list of tags.
|-
|-
| brand_name || character varying || NO || The brand name.
| properties
| The the tag data.
|-
|-
| equipment_type_id || integer || NO || A reference to the [[#rov.equipment_type|equipment type]].
| created_on
| The date and time of creation of the entity.
|-
|-
| model_name || character varying || NO || The model name.
| updated_on
| The date and time of the entity's last update.
|-
|-
| note || text || YES || An optional note about the model.
| name
| The text of the label.
|-
| label_tree_name
| The label tree name. If given identifies the label uniquely with the tree name.
|-
| event_type
|
|}
|}


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


This table creates an association between a [[#rov.model|model]] and [[#rov.library|documentation in the library]].
Stores the import packages created by principal investigators.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "model_documentation"
! Column
! Comment
|-
| id
|
|-
| user_id
| A reference to the [[#shared.mseauser|MSEA user]] that created the record.
|-
|-
! Name !! Type !! Nullable !! Documentation
| name
| A name of the import job
|-
|-
| library_id || integer || NO || A reference to the document in the [[#rov.library|library]].
| note
| An optional note about the import package.
|-
|-
| model_id || integer || NO || A reference to the [[#rov.model|model]].
| status
| A short description of the processing status of the job.
|-
|-
| 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.
| created_on
|}
| The date of creation of the record.
 
<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
| updated_on
| The date of update of the record.
|-
|-
| equipment_type_id || integer || NO || The [[#rov.equipment_type|equipment type]] ID.
| cruise_id
| A reference to the [[#rov.cruise|cruise]].
|-
|-
| model_id || integer || NO || A reference to the [[#rov.model|model]].
| hidden
|  
|}
|}


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


Observation categories are used by [[#rov.annotation_protocol|annotation protocols]].
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 "observation_category"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| name || character varying || NO || The name of the observation category.
| model_id
| A reference to the instrument [[#rov.model|model]].
|-
|-
| note || text || YES || An optional note about the observation category.
| serial_number
| 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.
|-
|-
| short_code || character varying || NO || A short code for referencing the observation category in import documents.
| retired
|}
| If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active.
 
|-
<span id="rov.observation_confidence"></span>
| attributes
=== Table: observation_confidence ===
| A freeform list of attributes for this instrument.
 
Provides a nominal observation confidence level for [[#rov.observation_event|observation events]].
 
{| class="wikitable"
|+ Columns in "observation_confidence"
|-
|-
! Name !! Type !! Nullable !! Documentation
| note
| An optional note about this instrument.
|-
|-
| name || character varying || NO || The textual representation of the confidence level.
| created_on
| The date of creation of this record.
|-
|-
| note || text || YES || A note about the confidence level.
| updated_on
| The date of update of this record.
|-
|-
| rank || integer || NO || This field is a way of ranking confidence levels so that an ordering can be established.
| organisation_id
| A reference to the organisation that owns and operates the instrument.
|-
|-
| 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.
| name
| A name for the instrument to distinguish it from others of the same model.
|}
|}


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


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.
==== instrument_config ====


{| class="wikitable"  
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 "observation_event"
 
|-
:: {| class="wikitable"
! Name !! Type !! Nullable !! Documentation
! Column
! Comment
|-
|-
| abundance_id || integer || YES || Link to an [[#rov.abundance|abundance level]].
| id
|  
|-
|-
| annotation_protocol_id || integer || NO || A reference to the [[#rov.annotation_protocol|annotation protocol]] used in the creation of this observation.
| configuration
| Configuration information about the instrument config.
|-
|-
| 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.
| note
| An optional note about this configuration.
|-
|-
| 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.
| created_on
| The date of creation of this record.
|-
|-
| coverage_id || integer || YES || Provides an indication of the amount of a scene [[#rov.coverage|covered]] by an organism. Implies habitat forming.
| updated_on
| The date of update of this record.
|-
|-
| event_id || integer || NO || A reference to the parent [[#rov.event|event]].
| platform_config_id
| The ID of the [[#rov.platform|platform]] upon which the instrument is used.
|-
|-
| observation_confidence_id || integer || YES || References the [[#rov.observation_confidence|observation confidence]] lookup to indicate the user's confidence in the observation.
| instrument_id
| Reference to the [[#rov.instrument|instrument]] targeted by the configuration.
|-
|-
| taxon_id || integer || YES || A reference to the [[#shared.taxon|taxon]] used in the creation of this observation.
| mark_for_delete
| Marks the entity for asynchronous deletion by the runner.
|}
|}


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


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.
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 "orientation"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| instrument_config_id || integer || NO || The [[#rov.instrument_config|configured instrument]] used to generate this item.
| measurement_type_id
| A reference to the [[#rov.measurement_type|type]] of this measurement.
|-
|-
| is_modelled || boolean || NO || A flag to indicate whether the value is derived from measurements by some modelling process.
| timestamp
| The time that the measurement was recorded.
|-
|-
| orientation || jsonb || NO || The orientation vector.
| quantity
| The scalar quantity or magnitude of the measurement.
|-
|-
| orientation_type_id || integer || NO || A reference to the [[#rov.orientation_type|orientation type]] of this orientation.
| signal_quality
| A quality of the measurement as reported by the instrument. TODO: Requires clarification.
|-
|-
| signal_quality || real || YES || The signal quality of the position as reported by the instrument. TODO: Requires clarification.
| is_modelled
| A flag to indicate whether the value is derived from measurements by some modelling process.
|-
|-
| timestamp || timestamp without time zone || NO || The time the position was recorded.
| instrument_config_id
| The [[#rov.instrument_config|configured instrument]] used to generate this item.
|-
| import_group_id
| A reference to the [[#rov.import_group|import group]], which tracks measurements which were imported at the same time, from the same file.
|}
|}


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


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 is a lookup table of types of measurement types for the [[#rov.measurement|measurement]] table. 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 "orientation_type"
! Column
! Comment
|-
| id
|
|-
| name
| The type of measurement. E.g., "Density" or "Salinity."
|-
|-
! Name !! Type !! Nullable !! Documentation
| unit
| The unit. SI units are preferred but not required. The unit selection should probably depend on field-specific idiomatic or cultural preferences.
|-
|-
| name || character varying || NO || The name of the orientation type (e.g., "Quaternion").
| minimum
| An optional lower bound on the value of the measurement. Null implies no limit.
|-
|-
| note || text || YES || An optional note about the orientation type.
| maximum
| An optional upper bound on the value of the measurement. Null implies no limit.
|-
|-
| 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.
| note
| An optional note about this measurement type.
|-
|-
| unit || character varying || NO || The units used to interpret the elements of the vector.
| short_code
| Contains a short code that can be used to look up a measurement type (e.g., during import) without relying on the primary key.
|}
|}


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


This table maintains the inventory of vehicles, that is, ships and ROVs.
A lookup table for data formats. This will include things like video, photo and acoustic. Medium formats can be discriminated as granularly as desired: as video/photo/acoustic/etc. or by format (JPG, MP4, AAC) and possibly more specific encoding parameters.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "platform"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| attributes || jsonb || YES || A freeform list of attributes for this platform.
| medium_type_id
| A reference to the [[#rov.medium_type|medium type]] (e.g., video or photo).
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| name
| The name of the format.
|-
|-
| model_id || integer || NO || A reference to the [[#rov.model|model]] of the platform.
| extensions
| 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 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
| An optional note about the format.
|-
|-
| note || text || YES || An optional note about this platform.
| short_code
|-
| Contains a short code that can be used to look up a medium format (e.g., during import) without relying on the primary key.
| organisation_id || integer || NO || A reference to the organisation that owns and operates the platform.
|}
 
<span id="rov.medium_type"></span>
 
==== medium_type ====
 
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"
! Column
! Comment
|-
|-
| retired || date || YES || If the platform is retired, this records the date. If null, the platform is assumed to be active.
| id
|  
|-
|-
| 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.
| name
| The name of the media type.
|-
|-
| 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.
| note
| An optional note about the media type.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
| short_code
| Provides a short code for looking up the entity.
|}
|}


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


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.
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"  
:: {| class="wikitable"
|+ Columns in "platform_config"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| configuration || jsonb || YES || The configuration data as a JSON object.
| brand_name
| The brand name.
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
| model_name
| The model name.
|-
|-
| note || text || YES || An optional note about the configuration record.
| attributes
| A free-form JSON field for attributes of this model.
|-
|-
| platform_id || integer || NO || A reference to the [[#rov.platform|platform]].
| note
| An optional note about the model.
|-
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
| equipment_type_id
| A reference to the [[#rov.equipment_type|equipment type]].
|}
|}


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


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?
Provides a nominal observation confidence level for [[#rov.event|observation events]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "position"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| geom || geometry || YES || The point geometry.
| name
| The textual representation of the confidence level.
|-
|-
| instrument_config_id || integer || NO || The [[#rov.instrument_config|configured instrument]] used to generate this item.
| rank
| This field is a way of ranking confidence levels so that an ordering can be established.
|-
|-
| is_modelled || boolean || NO || A flag to indicate whether the value is derived from measurements by some modelling process.
| note
| A note about the confidence level.
|-
|-
| position_type_id || integer || NO || A reference to the [[#rov.position_type|position type]] of this position.
| short_code
|-
| Contains a short code that can be used to look up a observation confidence (e.g., during import) without relying on the primary key.
| 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.position_type"></span>
<span id="rov.orientation"></span>
=== Table: position_type ===
 
==== orientation ====


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.
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 "position_type"
! Column
! Comment
|-
| id
|
|-
| orientation_type_id
| A reference to the [[#rov.orientation_type|orientation type]] of this orientation.
|-
|-
! Name !! Type !! Nullable !! Documentation
| timestamp
| The time the position was recorded.
|-
|-
| name || character varying || NO || The name of the position type. E.g., "Geographic" or "Yaw, Pitch, Roll."
| orientation
| The orientation vector.
|-
|-
| note || text || YES || An optional note about this position type.
| signal_quality
| The signal quality of the position as reported by the instrument. TODO: Requires clarification.
|-
|-
| 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.
| is_modelled
| A flag to indicate whether the value is derived from measurements by some modelling process.
|-
|-
| unit || character varying || NO || The unit. Linear or angular. E.g., "m" or "radians."
| instrument_config_id
| The [[#rov.instrument_config|configured instrument]] used to generate this item.
|}
|}


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


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.
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 "program"
! Column
|-
! Comment
! Name !! Type !! Nullable !! Documentation
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of this item.
| id
|  
|-
|-
| end_date || date || YES || The optional end date of the program.
| name
| The name of the orientation type (e.g., "Quaternion").
|-
|-
| name || character varying || NO || The name of the program.
| unit
| The units used to interpret the elements of the vector.
|-
|-
| note || text || YES || An optional note about the program.
| note
| An optional note about the orientation type.
|-
|-
| objective || character varying || YES || The objective or mandate of the program.
| short_code
|-
| Contains a short code that can be used to look up an orientation type (e.g., during import) without relying on the primary key.
| start_date || date || NO || The starting date of the program.
|-
| 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 this record.
|}
|}


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


A table to associate [[#rov.program|programs]] with [[#shared.library|library]] documents.
==== platform ====


{| class="wikitable"  
This table maintains the inventory of vehicles, that is, ships and ROVs.
|+ Columns in "program_library"
 
:: {| class="wikitable"
! Column
! Comment
|-
| id
|  
|-
|-
! Name !! Type !! Nullable !! Documentation
| model_id
| A reference to the [[#rov.model|model]] of the platform.
|-
|-
| library_id || integer || NO || A reference to the [[#shared.library|library]] item.
| name
| 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.
|-
|-
| program_id || integer || NO || A reference to the [[#rov.program|program]] item.
| serial_number
|}
| 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.
 
<span id="rov.program_member"></span>
=== Table: program_member ===
 
Assigns [[#rov.person|user]] [[#rov.program_role|roles]] to a [[#rov.program|program]].
 
{| class="wikitable"
|+ Columns in "program_member"
|-
|-
! Name !! Type !! Nullable !! Documentation
| retired
|  If the platform is retired, this records the date. If null, the platform is assumed to be active.
|-
|-
| person_id || integer || NO || A reference to the [[#rov.person|person]].
| attributes
| A freeform list of attributes for this platform.
|-
|-
| program_id || integer || NO || The reference to the [[#rov.program|program]].
| note
| An optional note about this platform.
|-
|-
| role_id || integer || NO || A reference to the [[#rov.program_role|program role]].
| created_on
|}
| The date of creation of this record.
 
<span id="rov.program_role"></span>
=== Table: program_role ===
 
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"
|+ Columns in "program_role"
|-
|-
! Name !! Type !! Nullable !! Documentation
| updated_on
| The date of update of this record.
|-
|-
| name || character varying || NO || The name of the role. E.g., "Chief Scientist."
| short_code
| Contains a short code that can be used to look up a platform (e.g., during import) without relying on the primary key.
|-
|-
| note || text || YES || An optional note about the role.
| organisation_id
| A reference to the organisation that owns and operates the platform.
|}
|}


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


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.
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 "protocol"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| name || character varying || NO || A name for the survey protocol.
| platform_id
| A reference to the [[#rov.platform|platform]].
|-
|-
| note || text || YES || An optional note about the protocol.
| configuration
| The configuration data as a JSON object.
|-
|-
| 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.
| note
|}
| An optional note about the configuration record.
 
<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
|-
|-
| name || character varying || NO || The textual representation of the relief level.
| created_on
| The date of creation of this record.
|-
|-
| note || text || YES || A note about the relief level.
| updated_on
| The date of update of this record.
|-
|-
| 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.
| mark_for_delete
| Marks the entity for asynchronous deletion by the runner.
|}
|}


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


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]].
==== position ====


{| class="wikitable"  
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?
|+ Columns in "status_event"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| event_id || integer || NO || The associated [[#rov.event|event]].
| position_type_id
| A reference to the [[#rov.position_type|position type]] of this position.
|-
|-
| status_type_detail_id || integer || NO || The [[#rov.status_type_detail|detailed status type]].
| timestamp
|}
| The time the position was recorded.
 
|-
<span id="rov.status_type"></span>
| signal_quality
=== Table: status_type ===
| The signal quality of the position as reported by the instrument. TODO: Requires clarification.
 
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 !! Type !! Nullable !! Documentation
| geom
| The point geometry.
|-
|-
| name || character varying || NO || The name of the status event.
| is_modelled
| A flag to indicate whether the value is derived from measurements by some modelling process.
|-
|-
| note || text || YES || An optional description of the status type.
| instrument_config_id
| The [[#rov.instrument_config|configured instrument]] used to generate this item.
|-
|-
| short_code || character varying || NO || A short code for referencing the status type in import documents.
| import_group_id
| A reference to the [[#rov.import_group|import group]], which tracks positions which were imported at the same time, from the same file.
|}
|}


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


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.
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 "status_type_detail"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| 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.
| name
| The name of the position type. E.g., "Geographic" or "Yaw, Pitch, Roll."
|-
|-
| note || text || YES || Optional extended description of detail.
| unit
| The unit. Linear or angular. E.g., "m" or "radians."
|-
|-
| 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.
| note
| An optional note about this position type.
|-
|-
| status_type_id || integer || NO || A reference to the [[#rov.status_type|status type]].
| short_code
| Contains a short code that can be used to look up a position type (e.g., during import) without relying on the primary key.
|}
|}


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


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.
This is a listing of scientific or other programs that can be associated with [[#rov.cruise|cruises]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "substrate"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| name || character varying || NO || The name of the substrate.
| name
| The name of the program.
|-
|-
| note || text || YES || An optional description of the substrate.
| objective
| The objective or mandate of the program.
|-
|-
| 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.
| start_date
|}
| The starting date of the program.
|-
| end_date
| The optional end date of the program.
|-
| note
| An optional note about the program.
|-
| created_on
| The date of creation of this item.
|-
| updated_on
| The date of update of this record.
|-
| summary
| A summary of the [[#rov.program|program]]; whether objectives were met, problems encountered, etc.
|}
 
<span id="rov.program_member"></span>


<span id="rov.survey_mode"></span>
==== program_member ====
=== 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.
Assigns [[#shared.person|user]] [[#rov.program_role|roles]] to a [[#rov.program|program]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "survey_mode"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| name || character varying || NO || The name of the survey mode.
| program_id
| The reference to the [[#rov.program|program]].
|-
|-
| note || text || YES || An optional note about the survey mode.
| person_id
| A reference to the [[#shared.person|person]].
|-
|-
| 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.
| role_id
| A reference to the [[#rov.program_role|program role]].
|}
|}


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


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.
Represents the roles a [[#shared.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 "thickness"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| maximum || real || YES || The maximum value in the range.
| name
| The name of the role. E.g., "Chief Scientist."
|-
|-
| minimum || real || YES || The minimum value in the range.
| note
|-
| An optional note about the role.
| 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>
<span id="rov.protocol"></span>
=== Table: transect ===
 
==== protocol ====


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]].
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.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "transect"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| attributes || jsonb || YES || A JSON column used for recording structured attributes that do not fit with the regular table structure.
| name
| A name for the survey protocol.
|-
|-
| dive_id || integer || NO || A reference to the [[#rov.dive|dive]] during which this transect occurred.
| note
| An optional note about the protocol.
|-
|-
| end_time || timestamp without time zone || YES || The end time of the transect.
| short_code
| Contains a short code that can be used to look up a survey protocol (e.g., during import) without relying on the primary key.
|}
 
<span id="rov.relief"></span>
 
==== relief ====
 
Provides a nominal level of terrain relief for [[#rov.event|habitat events]].
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
| name || character varying || NO || The name of the transect.
| id
|  
|-
|-
| note || text || YES || An optional note about the transect.
| name
| The textual representation of the relief level.
|-
|-
| objective || text || YES || A statement of the practical or research objectives for this true.
| note
| A note about the relief level.
|-
|-
| start_time || timestamp without time zone || NO || The start time of the transect.
| short_code
|-
| Contains a short code that can be used to look up a relief (e.g., during import) without relying on the primary key.
| summary || text || YES || A summary of the [[#rov.transect|transect]]; whether objectives were met, problems encountered, etc.
|}
|}


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


Surface weather observations can be recorded by any [[#rov.cruise_leg_crew|crew member]] aboard a ship during a [[#rov.cruise_leg|cruise leg]].
Stores the region within which sign-ups are permitted, generally North America.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "weather_observation"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| cruise_crew_id || integer || YES || A reference to the [[#rov.cruise_leg_crew|cruise leg crew]] member who is making the report.
| name
| The name of the sign-up region.
|-
|-
| cruise_id || integer || NO || A link to the [[#rov.cruise|cruise]] during which this record was recorded.
| geom
| The geometry of the sign-up region.
|}
 
<span id="rov.status_type"></span>
 
==== 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"
! Column
! Comment
|-
|-
| note || text || YES || An optional note about the observation
| id
|  
|-
|-
| pressure || real || YES || The air pressure.
| name
| The name of the status event.
|-
|-
| swell || character varying || YES || Description of swell.
| note
| An optional description of the status type.
|-
|-
| temperature || real || YES || The air temperature.
| short_code
|-
| A short code for referencing the status type in import documents.
| 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>
<span id="rov.status_type_detail"></span>
=== Materialized View: cruise_track ===
 
==== status_type_detail ====


Constructs a geometry for each [[#rov.cruise|cruise]] which describes the path of the ship.
This table associates a [[#rov.status_type|status type]] with a [[#rov.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 "cruise_track"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| colour || text || False || The a colour code generated from the cruise's ID used for cartography.
| status_type_id
| A reference to the [[#rov.status_type|status type]].
|-
|-
| cruise_id || integer || False || The reference to the [[#rov.cruise|cruise]].
| name
| 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.
|-
|-
| cruise_name || text || False || The [[#rov.cruise|cruise]] name and leg.
| note
| Optional extended description of detail.
|-
|-
| geom || geometry || False || The cruise track geometry.
| short_code
|-
| 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.
| instrument_config_id || integer || False || The reference to the [[#rov.instrument_config|instrument configuration]].
|}
|}


<span id="rov.depth"></span>
<span id="rov.substrate"></span>
=== Materialized View: depth ===


A view on the [[#rov.measurements|measurements]] table containing only depths.
==== substrate ====


{| class="wikitable"  
A lookup table listing the available substrate types for the [[#rov.event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
|+ Columns in "depth"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| dive_id || integer || False || The ID of the [[#rov.dive|dive]] during which the depth was measured.
| name
| The name of the substrate.
|-
|-
| quantity || real || False || [None]
| note
| An optional description of the substrate.
|-
|-
| timestamp || timestamp(6) without time zone || False || The timestamp of the record.
| short_code
| 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.dive_track"></span>
<span id="rov.survey_mode"></span>
=== Materialized View: dive_track ===
 
==== survey_mode ====


Constructs a geometry for each [[#rov.dive|dive]] which describes the path of the submersible.
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 "dive_track"
! Column
|-
! Comment
! 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.
| id
|  
|-
|-
| geom || geometry || False || The dive track geometry.
| name
| The name of the survey mode.
|-
|-
| transect_id || integer || False || The reference to the [[#rov.transect|transect]]. Zero if there is no corresponding transect.
| note
| An optional note about the survey mode.
|-
|-
| transect_name || character varying(64) || False || The [[#rov.transect|transect]] name.
| short_code
| 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.evt_depth"></span>
<span id="rov.thickness"></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.
==== thickness ====
 
A lookup table listing the available substrate thicknesses for the [[#rov.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 "evt_depth"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| end_diff || interval || False || [None]
| name
| A characterization of biocover thickness.
|-
|-
| 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.
| minimum
| The minimum value in the range.
|-
|-
| event_id || integer || False || The link to the [[#rov.event|event's]]'s event ID.
| maximum
| The maximum value in the range.
|-
|-
| start_diff || interval || False || [None]
| note
| An optional note about the biocover thickness.
|-
|-
| start_measurement_id || integer || False || The link to the [[#rov.measurement|depth]] nearest the event's start time.
| short_code
| 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.evt_pos"></span>
<span id="rov.transect"></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.
==== transect ====


{| class="wikitable"  
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]].
|+ Columns in "evt_pos"
 
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| dive_id
| A reference to the [[#rov.dive|dive]] during which this transect occurred.
|-
| name
| The name of the transect.
|-
| objective
| A statement of the practical or research objectives for this true.
|-
|-
! Name !! Type !! Nullable !! Documentation
| start_time
| The start time of the transect.
|-
|-
| end_diff || interval || False || [None]
| end_time
| The end time of the transect.
|-
|-
| 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.
| note
| An optional note about the transect.
|-
|-
| event_id || integer || False || The link to the [[#rov.event|event's]]'s event ID.
| attributes
| A JSON column used for recording structured attributes that do not fit with the regular table structure.
|-
|-
| start_diff || interval || False || [None]
| summary
| A summary of the [[#rov.transect|transect]]; whether objectives were met, problems encountered, etc.
|-
|-
| start_position_id || integer || False || The link to the [[#rov.position|position]] nearest the event's start time.
| admin_note
|  
|}
|}


<span id="rov.measurement_position"></span>
<span id="rov.weather_observation"></span>
=== Materialized View: measurement_position ===
 
==== weather_observation ====


Creates a relation between a [[#rov.measurement|measurement]] and the temporally-nearest [[#rov.position|position]].
Surface weather observations can be recorded by any [[#rov.cruise_crew|crew member]] aboard a ship during a [[#rov.cruise|cruise leg]].


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "measurement_position"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| measurement_id || integer || False || The link to the [[#rov.measurement|measurement]].
| cruise_crew_id
| A reference to the [[#rov.cruise_crew|cruise leg crew]] member who is making the report.
|-
|-
| position_id || integer || False || The link to the [[#rov.position|position]].
| temperature
| The air temperature.
|-
| pressure
| The air pressure.
|-
| wind_speed
| The wind speed.
|-
| wind_direction
| The wind direction.
|-
| swell
| Description of swell.
|-
| time
| An optional note about the weather.
|-
| note
| An optional note about the observation
|-
| cruise_id
| A link to the [[#rov.cruise|cruise]] during which this record was recorded.
|}
|}


<span id="shared"></span>
 
<span id="{schema}"></span>
 
== Schema: shared ==
== Schema: shared ==


Stores data that are shared between other schemas, such as personnel information, taxonomy, etc.
Contains tables that support all applications on the server, such as the "person" table, which provides personnel lists.
 
=== Tables ===


<span id="shared.db_version"></span>
<span id="shared.db_version"></span>
=== Table: db_version ===
 
==== db_version ====


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


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "db_version"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| revision || integer || NO || The revision number.
| version_major
| The major version.
|-
|-
| updated_on || timestamp without time zone || NO || The time the upgrade was performed.
| version_minor
| The minor version number.
|-
|-
| version_major || integer || NO || The major version.
| updated_on
| The time the upgrade was performed.
|-
|-
| version_minor || integer || NO || The minor version number.
| revision
| The revision number.
|}
|}


<span id="shared.file"></span>
<span id="shared.file"></span>
=== Table: file ===
 
==== 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.
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 "file"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| 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.
| file_type_id
| An optional reference to the [[#shared.file_type|file type]].
|-
|-
| 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).
| name
| The name for the file.
|-
|-
| description || text || YES || An optional description for the file.
| description
| An optional description for the file.
|-
|-
| file_type_id || integer || YES || An optional reference to the [[#shared.file_type|file type]].
| metadata
| A JSON dictionary containing metadata relating to the file.
|-
|-
| hash || character varying || NO || And MD5 hash of the file data. Used to compare files and search for identical versions.
| path
| A path of the file, relative to the root directory where files are stored.
|-
|-
| metadata || jsonb || YES || A JSON dictionary containing metadata relating to the file.
| created_on
| The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
|-
|-
| name || character varying || NO || The name for the file.
| updated_on
| The update time of the file record, not necessarily the file itself (this should be stored in metadata).
|-
|-
| path || character varying || NO || A path of the file, relative to the root directory where files are stored.
| hash
| And MD5 hash of the file data. Used to compare files and search for identical versions.
|-
|-
| 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).
| blob_url
| 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.
|}
|}


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


A list of file types.
A list of file types.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "file_type"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| name || character varying || NO || The name of the file type.
| name
| The name of the file type.
|-
|-
| short_code || character varying || NO || A short code for referencing the file type in import documents.
| short_code
| A short code for referencing the file type in import documents.
|}
|}


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


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.
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 "hart_taxon"
! Column
! Comment
|-
| id
|  
|-
|-
! Name !! Type !! Nullable !! Documentation
| user_id
| A reference to the [[#public.auth_user|Django user]].
|-
|-
| authority || text || YES || The identification authority.
| biigle_username
| The Biigle username.
|-
|-
| common_name || character varying || YES || The common name.
| biigle_api_key
| The Biigle API key.
|-
|-
| from_date || date || YES || ?
| pg_role
| The name of the PostgreSQL role that the user will use to log in directly to the database.
|-
|-
| grouping_id || integer || YES || The grouping. * B - Bird * F - Fish * I - Invertebrate * M - Mammal * O - Object? * R - Reptile
| organization
| The organization with which a user is affiliated.
|-
|-
| 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.
| org_type
| The the type of organization with which the user is affiliated.
|-
|-
| nodc_code_v7 || real || YES || The NODC code, v7.
| registration_reason
| A short note about why the user registered.
|-
|-
| nodc_code_v8 || integer || YES || The NODC code, V8. Identical to the ITIS ID.
| bio
| Biographical information about the user.
|-
|-
| rank_id || integer || YES || A three-letter code indicating the taxonomic level.
| verification_code
| An auto-generated string used to identify the user for verification purposes.
|-
|-
| scientific_name || character varying || YES || The scientific (e.g., Linnean) name.
| verification_expiry
| The time of expiration of the verification code.
|-
|-
| sp_species_code || character varying || YES || Another species code whose purpose/origin is not known.
| verification_time
| The date and time at which the user was verified.
|-
|-
| species_code || character varying || NO || The species, or Hart, code.
| registration_ip
| The IP used by the user to register.
|-
|-
| species_prov_code || character varying || YES || ?
| ip_in_region
| Set to true if the user's IP is within the signup region. False positives and negatives are possible.
|-
|-
| taxa_reference || text || YES || The reference for the identification.
| registration_note
| Administrator notes about the user's registration status.
|-
|-
| to_date || date || YES || ?
| allowed
| 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.
|}
|}


<span id="shared.library"></span>
<span id="shared.organisation"></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.
==== organisation ====


{| class="wikitable"  
Convenient storage for organisations involved in MSEA activities.
|+ Columns in "library"
 
:: {| class="wikitable"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| abstract || text || YES || The abstract of the entry.
| name
| The full name of the organisation.
|-
|-
| 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.
| country
| The code for the country where the organisation is based (e.g., "CA" for Canada).
|-
|-
| 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).
| note
|-
| An optional note about the organisation.
| doi || character varying || YES || The DOI of the document.
|}
 
<span id="shared.person"></span>
 
==== 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"
! Column
! Comment
|-
|-
| file_id || integer || NO || An optional reference to a [[#shared.file|file]].
| id
|  
|-
|-
| institution || character varying || YES || The name of the institution or publisher responsible for the document.
| biigle_user_id
| The Biigle database ID of a user. The UUID should be used instead.
|-
|-
| isbn || character varying || YES || The ISBN of the book, if it is a book.
| first_name
| First name.
|-
|-
| issn || character varying || YES || The ISSN of the entry.
| last_name
| Last name.
|-
|-
| keywords || jsonb || YES || A list of keywords relating to the entry.
| email
| Email address.
|-
|-
| mendeley_id || character varying || YES || The ID of the record in Mendeley.
| photo
| A photo of the person.
|-
|-
| publication || character varying || YES || The name of the publication in which the document appeared.
| bio
| A brief biography of the person.
|-
|-
| title || text || NO || The title of the book, paper, or other document.
| biigle_uuid
| The Biigle UUID is used to identify the user in Biigle apps.
|-
|-
| type || character varying || YES || Describes the type of entry: book, article, etc.
| affiliation
|-
| The organization with which this user is currently affiliated.
| 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>
<span id="shared.restriction"></span>
=== Table: mseauser ===
 
==== restriction ====


Represents an MSEA user and is linked to a single Django auth User. Stores extra application-related properties such as the Biigle API key.
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 "mseauser"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| biigle_api_key || character varying || YES || The Biigle API key.
| name
| The name of the restriction.
|-
|-
| biigle_username || character varying || YES || The Biigle username.
| key
| The top-level property name or key.
|-
|-
| pg_role || character varying || YES || The name of the PostgreSQL role that the user will use to log in directly to the database.
| pattern
| 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'.
|-
|-
| user_id || integer || NO || A reference to the [[#public.auth_user|Django user]].
| note
| An optional note about the restriction.
|-
| created_on
| The date of creation of the restriction.
|-
| updated_on
| The date of last update of the restriction.
|}
|}


<span id="shared.mseauser_restriction"></span>
<span id="shared.restriction_group"></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.
==== restriction_group ====


{| class="wikitable"  
Links the restriction to a group. Members of linked groups are able to view the restricted items.
|+ Columns in "mseauser_restriction"
 
|-
:: {| class="wikitable"
! Name !! Type !! Nullable !! Documentation
! Column
|-
! Comment
| 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]].
| id
|  
|-
|-
| restriction_id || integer || NO || The ID of the [[#shared.restriction|restriction]].
| restriction_id
| The ID of the [[#shared.restriction|restriction]].
|-
|-
| updated_on || timestamp without time zone || NO || The last update time of the record.
| group_id
| The ID of the Django authentication group.
|}
|}


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


A table for news items related to each sub-site.
==== site ====


{| class="wikitable"  
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 "news_item"
 
|-
:: {| class="wikitable"
! Name !! Type !! Nullable !! Documentation
! Column
! Comment
|-
|-
| content || text || NO || The content of the item.
| id
|  
|-
|-
| created_on || timestamp without time zone || NO || The date of creation of the item.
| spatial_library_id
| A reference to the [[#shared.spatial_library|spatial library]] entry.
|-
|-
| 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.
| name
| A name for the site.
|-
|-
| title || character varying || NO || A title for the item.
| note
| An optional note about the site.
|}
|}


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


Convenient storage for organisations involved in MSEA activities.
Maintains a library of spatial data.


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "organisation"
! Column
! Comment
|-
|-
! Name !! Type !! Nullable !! Documentation
| id
|
|-
|-
| country || character varying || NO || The code for the country where the organisation is based (e.g., "CA" for Canada).
| file_id
| A reference to a related [[#shared.file|file]].
|-
|-
| name || character varying || NO || The full name of the organisation.
| name
| A name for the entry.
|-
|-
| note || text || YES || An optional note about the organisation.
| note
| A note about this library item.
|-
|-
| short_code || character varying || NO || A short code for looking up the entity; usually the organisation's acronym.
| thumbnail
|}
| A small thumbnail in binary (JPG) form.
 
|-
<span id="shared.person"></span>
| created_on
=== Table: person ===
| The time when this record was created.
 
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.
| updated_on
| The date of update of this record.
|-
|-
| bio || text || YES || A brief biography of the person.
| geom
| A vector representation of the object(s), projected into WGS84 (lat/lon) and stored as a geography type.
|-
|-
| email || character varying || NO || Email address.
| metadata
| A JSON object containing metadata related to the spatial object.
|-
|-
| first_name || character varying || NO || First name.
| rast
|-
| A raster.
| last_name || character varying || NO || Last name.
|-
| photo || bytea || YES || A photo of the person.
|}
|}


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


Provides a list of restrictions that can be applied to individual observation rows, to restrict access to allowed roles.
==== spatial_library_file ====


{| class="wikitable"
Allows a [[#shared.spatial_library|spatial library]] entity to own more than one file.
|+ 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"  
:: {| class="wikitable"
|+ Columns in "site"
! Column
|-
! Comment
! Name !! Type !! Nullable !! Documentation
|-
|-
| name || character varying || NO || A name for the site.
| id
|  
|-
|-
| note || text || YES || An optional note about the site.
| spatial_library_id
| A link to the [[#shared.spatial_library|spatial library]].
|-
|-
| spatial_library_id || integer || YES || A reference to the [[#shared.spatial_library|spatial library]] entry.
| file_id
| A link to the [[#shared.file|file]].
|}
|}


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


Maintains a library of spatial data.
==== uploaded_file ====


{| class="wikitable"
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 "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.
|}
 
<span id="wiki"></span>
== Schema: wiki ==
 
Stores data related to the Wiki using the standard [https://www.mediawiki.org/wiki/MediaWiki MediaWiki] structure.
 
<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"  
:: {| class="wikitable"
|+ Columns in "slots"
! Column
|-
! Comment
! Name !! Type !! Nullable !! Documentation
|-
| slot_content_id || bigint || NO || [None]
|-
|-
| slot_origin || bigint || NO || [None]
| id
|  
|-
|-
| slot_revision_id || bigint || NO || [None]
| path
| The path to the temporary location of the file.
|-
|-
| slot_role_id || smallint || NO || [None]
| type
|}
| The guessed MIME type of the file.
 
<span id="wiki.templatelinks"></span>
=== Table: templatelinks ===
 
None
 
{| class="wikitable"
|+ Columns in "templatelinks"
|-
|-
! Name !! Type !! Nullable !! Documentation
| name
| The original name of the file.
|-
|-
| tl_from || integer || NO || [None]
| created_on
| The time of creation of the record.
|-
|-
| tl_from_namespace || integer || NO || [None]
| expires_on
| The expiry time of the file. It may be deleted by a maintenance script after this time.
|-
|-
| tl_target_id || bigint || NO || [None]
| marked_for_delete
| If true, the file is marked for delete. Otherwise it will not be touched unless there is an age limit set in the daemon.
|}
|}


<span id="wiki.text"></span>
=== Table: text ===


None
<span id="{schema}"></span>


{| class="wikitable"
== Schema: taxonomy ==
|+ 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>
Contains taxonomic information from a variety of sources including WoRMS, iNaturalist and the Hart list used by DFO.
=== Table: updatelog ===


None
=== Tables ===


{| class="wikitable"  
<span id="taxonomy.taxon"></span>
|+ Columns in "updatelog"
|-
! Name !! Type !! Nullable !! Documentation
|-
| ul_key || character varying || NO || [None]
|-
| ul_value || text || YES || [None]
|}


<span id="wiki.uploadstash"></span>
==== taxon ====
=== Table: uploadstash ===


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


{| class="wikitable"  
:: {| class="wikitable"
|+ Columns in "uploadstash"
! Column
|-
! Comment
! 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]
|-
| us_media_type || USER-DEFINED || YES || [None]
|-
|-
| us_mime || character varying || YES || [None]
| id
|  
|-
|-
| us_orig_path || character varying || NO || [None]
| taxon_id
| The taxonomic ID from the source database.
|-
|-
| us_path || character varying || NO || [None]
| source
| The name of the source database: "inaturalist", "worms", "obis", etc.
|-
|-
| us_props || text || YES || [None]
| rank
| The name of the taxonomic rank of the record, e.g., "class", "subspecies", etc.
|-
|-
| us_sha1 || character varying || NO || [None]
| scientific_name
| The scientific name of the species.
|-
|-
| us_size || integer || NO || [None]
| common_name
| The common name of the species.
|-
|-
| us_source_type || character varying || YES || [None]
| superdomain
| The superdomain name.
|-
|-
| us_status || character varying || NO || [None]
| domain
| The domain name.
|-
|-
| us_timestamp || timestamp with time zone || NO || [None]
| kingdom
|-
| The kingdom name.
| us_user || integer || NO || [None]
|}
 
<span id="wiki.user"></span>
=== Table: user ===
 
None
 
{| class="wikitable"
|+ Columns in "user"
|-
|-
! Name !! Type !! Nullable !! Documentation
| subkingdom
| The subkingdom name.
|-
|-
| user_editcount || integer || YES || [None]
| infrakingdom
| The infrakingdom name.
|-
|-
| user_email || text || NO || [None]
| phylum
| The phylum name.
|-
|-
| user_email_authenticated || timestamp with time zone || YES || [None]
| phylum_division
| The phylum division name.
|-
|-
| user_email_token || text || YES || [None]
| subphylum_subdivision
| The subphylum division name.
|-
|-
| user_email_token_expires || timestamp with time zone || YES || [None]
| subphylum
| The subphylum name.
|-
|-
| user_id || integer || NO || [None]
| infraphylum
| The infraphylum name.
|-
|-
| user_name || text || NO || [None]
| parvphylum
| The parvphylum name.
|-
|-
| user_newpass_time || timestamp with time zone || YES || [None]
| gigaclass
| The gigaclass name.
|-
|-
| user_newpassword || text || NO || [None]
| megaclass
| The megaclass name.
|-
|-
| user_password || text || NO || [None]
| superclass
| The superclass name.
|-
|-
| user_password_expires || timestamp with time zone || YES || [None]
| class
| The "class" name.
|-
|-
| user_real_name || text || NO || [None]
| subclass
| The subclass name.
|-
|-
| user_registration || timestamp with time zone || YES || [None]
| infraclass
| The infraclass name.
|-
|-
| user_token || text || NO || [None]
| subterclass
| The subterclass name.
|-
|-
| user_touched || timestamp with time zone || NO || [None]
| superorder
|}
| The superorder name.
 
<span id="wiki.user_autocreate_serial"></span>
=== Table: user_autocreate_serial ===
 
None
 
{| class="wikitable"
|+ Columns in "user_autocreate_serial"
|-
|-
! Name !! Type !! Nullable !! Documentation
| order
| The "order" name.
|-
|-
| uas_shard || integer || NO || [None]
| suborder
| The suborder name.
|-
|-
| uas_value || integer || NO || [None]
| infraorder
|}
| The infraorder name.
 
<span id="wiki.user_former_groups"></span>
=== Table: user_former_groups ===
 
None
 
{| class="wikitable"
|+ Columns in "user_former_groups"
|-
|-
! Name !! Type !! Nullable !! Documentation
| parvorder
| The parvorder name.
|-
|-
| ufg_group || text || NO || [None]
| superfamily
| The superfamily name.
|-
|-
| ufg_user || integer || NO || [None]
| family
|}
| The family name.
 
<span id="wiki.user_groups"></span>
=== Table: user_groups ===
 
None
 
{| class="wikitable"
|+ Columns in "user_groups"
|-
|-
! Name !! Type !! Nullable !! Documentation
| subfamily
| The subfamily name.
|-
|-
| ug_expiry || timestamp with time zone || YES || [None]
| supertribe
| The supertribe name.
|-
|-
| ug_group || text || NO || [None]
| tribe
| The tribe name.
|-
|-
| ug_user || integer || NO || [None]
| subtribe
|}
| The subtribe name.
 
<span id="wiki.user_newtalk"></span>
=== Table: user_newtalk ===
 
None
 
{| class="wikitable"
|+ Columns in "user_newtalk"
|-
|-
! Name !! Type !! Nullable !! Documentation
| genus
| The genus name.
|-
|-
| user_id || integer || NO || [None]
| genus_hybrid
| The genus hybrid name.
|-
|-
| user_ip || text || NO || [None]
| subgenus
| The subgenus name.
|-
|-
| user_last_timestamp || timestamp with time zone || YES || [None]
| section
|}
| The section name.
 
<span id="wiki.user_properties"></span>
=== Table: user_properties ===
 
None
 
{| class="wikitable"
|+ Columns in "user_properties"
|-
|-
! Name !! Type !! Nullable !! Documentation
| subsection
| The subsection name.
|-
|-
| up_property || text || NO || [None]
| series
| The series name.
|-
|-
| up_user || integer || NO || [None]
| species
| The species name.
|-
|-
| up_value || text || YES || [None]
| hybrid
|}
| The hybrid name.
 
<span id="wiki.watchlist"></span>
=== Table: watchlist ===
 
None
 
{| class="wikitable"
|+ Columns in "watchlist"
|-
|-
! Name !! Type !! Nullable !! Documentation
| subspecies
| The subspecies name.
|-
|-
| wl_id || integer || NO || [None]
| natio
| The natio name.
|-
|-
| wl_namespace || integer || NO || [None]
| variety
| The variety name.
|-
|-
| wl_notificationtimestamp || timestamp with time zone || YES || [None]
| subvariety
| The subvariety name.
|-
|-
| wl_title || text || NO || [None]
| form
| The form name.
|-
|-
| wl_user || integer || NO || [None]
| subform
|}
| The subform name.
 
<span id="wiki.watchlist_expiry"></span>
=== Table: watchlist_expiry ===
 
None
 
{| class="wikitable"
|+ Columns in "watchlist_expiry"
|-
|-
! Name !! Type !! Nullable !! Documentation
| no_common_name
| If a search has been performed for a common name and none was found, this prevents the processor from trying again.
|-
|-
| we_expiry || timestamp with time zone || NO || [None]
| accepted_taxon_id
| The taxon ID of the accepted taxon for this unaccepted taxon. If this column is null, the taxon is accepted.
|-
|-
| we_item || integer || NO || [None]
| parent_taxon_id
| The taxon ID of the taxon's parent taxon. If this column is null, the taxon has no parents.
|}
|}
<!-- END GENERATED CONTENT -->

Latest revision as of 02:44, 21 September 2025

Database entity documentation is generated automatically from the production database by the Django task, db_documentation.py. The script automatically modifies this page, replacing the text between the <!-- BEGIN GENERATED CONTENT --> and <!-- END GENERATED CONTENT --> tags.

Documentation resides in the database itself, in the form of comments on the relations and columns, and 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 on MSEA's tables are managed using DDL, as described on the Database Upgrades page. Many other tables are generated by application frameworks and are not documented.

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

Schema: admin

Contains tables relevant to the maintenance and operation of the database.

Tables

cache_table

A table containing information about cache refreshment procedures and the tables they impact. The cache_refresh_tables procedure will read this table and execute the procedures stored therein.

Column Comment
id
table_name Stores the name of the table impacted by the associated cache procedure. Triggers will be disabled on the table, then re-enabled.
proc_name The name of the cache refresh procedure to be called.
created_on
updated_on


Schema: cache

Contains cached representations of data tables, intended bypass complex joins to speed data extraction and improve user experience.

Tables

cruise_stats

Stores compiled statistics for cruises.

Column Comment
id
cruise_id The ID of the cruise.
name The name of the cruise.
leg The cruise leg.
start_date The start date of the cruise.
end_date The end date of the cruise.
num_dives The number of dives performed during the cruise.
num_measurements The number measurements collected during the cruise.
num_positions The number positions collected during the cruise.
num_habitats The number habitats annotated during the cruise.
num_observations The number observations annotated during the cruise.
is_approved
num_transects The number of transects that occurred during this cruise.
num_taxa The number of taxa observed during this cruise.
num_cruise_crew The number of crew members configured for this cruise.
num_dive_crew The number of crew members configured for the dives of this cruise.
num_ap_docs The number of documents attached to an annotation protocol used to annotate this cruise's data.
num_cruise_docs True if there is at least one document attached this cruise.
has_fov True if the cruise has field of view measurements.

cruise_track

Constructs a geometry for each cruise which describes the path of the ship.

Column Comment
cruise_id The reference to the cruise.
cruise_name The cruise name and leg.
colour The a colour code generated from the cruise's ID used for cartography.
geom The cruise track geometry.

dive_track

Constructs a geometry for each dive which describes the path of the submersible.

Column Comment
dive_id The reference to the dive.
cruise_id The reference to the cruise.
dive_name The dive name.
cruise_name The cruise name.
colour The a colour code generated from the cruise's ID. Used for cartography.
geom The dive track geometry.

evt_depth

Creates a relation between an event and the depth nearest the start and end times of the event.

Column Comment
event_id The link to the event's event ID.
instrument_config_id The link to the instrument configuration.
timestamps The array of timestamps corresponding to the depths.
depths The array of depths between the event's start and end times. If the event covers a span of time, multiple depths are returned.

evt_measurement

Creates a relation between an event and the measurement nearest the start and end times of the event.

Column Comment
event_id The link to the event's event ID.
instrument_config_id The link to the instrument configuration.
measurement_type_id The link to the measurement type.
timestamps The array of timestamps corresponding to the measurements.
measurements The array of measurements between the event's start and end times. If the event covers a span of time, multiple measurements are returned.

evt_pos

Creates a relation between an event and the positions within the span of the event, as a MultiPoint.

Column Comment
event_id The link to the event's's event ID.
instrument_config_id The link to the instrument configuration.
timestamps The list of timestamps corresponding to the geometries in the geoms column.
geoms The list of positions comprising the ROV track during the time span of the event. A MultiPoint.

transect_track

Constructs a geometry for each transect which describes the path of the submersible.

Column Comment
transect_id The reference to the transect.
dive_id The reference to the dive.
cruise_id The reference to the cruise.
transect_name The transect name.
dive_name The dive name.
cruise_name The cruise name.
colour The a colour code generated from the cruise's ID. Used for cartography.
geom The transect track geometry.


Schema: geo

Contains spatial objects, such as vectors which can be visualized on a map or used to query other tables.

Tables

area

Stores area geometries linked to area groups.

Column Comment
id
area_group_id
name_en The english name of the area.
name_fr The french name of the area.
properties A JSON object containing properties of the area.
geom The area geometry, a MultiPolygon.

area_group

Stores groups of similar areas, such as MPAs, seamounts, etc. Linked by areas.

Column Comment
id
name_en The english name of the area group.
name_fr The french name of the area group.
description_en The english description of the area group.
description_fr The french description of the area group.


Schema: maxmind

Contains data provided by Maxmind, which provides geolocation of users based on their IP address.

Tables

geoip_city_blocks

Contains both IPv4 and IPv6 network addresses, which reference locations in the geoip_city_locations table.

Column Comment
network The network address, IPv4 or IPv6.
geoname_id References the location ID in the geoip_city_locations table.
registered_country_geoname_id The location ID in the geoip_city_locations table which is registered to the network address.
represented_country_geoname_id The location ID in the geoip_city_locations table from which the IP comes.
is_anonymous_proxy True if the address is of an anonymous proxy.
is_satellite_provider True if the address is used by a satellite network provider.
postal_code The postal code of the location.
latitude The latitude of the geographic center of a region, defined by the accuracy radius, which contains the location.
longitude The longitude of the geographic center of a region, defined by the accuracy radius, which contains the location.
accuracy_radius The radius (m) of a circle within which the location is located.
is_anycast True if the address is that of an Anycast network.
location
region

geoip_city_locations

Stores the country, region and city data for GeoIP.

Column Comment
geoname_id The internal GeoIP city ID.
locale_code The two-character local code.
continent_code The two-character ISO continent code.
continent_name The continent name
country_iso_code The two-character ISO country code.
country_name The country name
subdivision_1_iso_code The ISO subdivision 1 code.
subdivision_1_name The ISO subdivision 1 name.
subdivision_2_iso_code The ISO subdivision 2 code.
subdivision_2_name The ISO subdivision 2 name.
city_name The city name.
metro_code The three-digit metro code.
time_zone The name of the time zone.
is_in_european_union True if the location is within the European Union.

geoip_last_update

Stores the time of last update of the database.

Column Comment
last_update The time of last update of the database.


Schema: ndst

Tables related to the dive logging Shiny App used by NDST to record cruise data.

Tables

cruise

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

Column Comment
row_id A UUID providing a universally-unique identifier for the cruise.
name The name of the cruise.
leg The leg of the cruise. Should start at 1 and increase.
objective
summary A summary of the cruise, its accomplishments, problems, etc.
note The objective of the cruise.
status The current status of the cruise viz. database import.
created_on The date and time of creation of the entity.
updated_on The date and time of the entity's last update.
id
active Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
hide True if the entity should be hidden in the UI.

diveconfig

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

Column Comment
row_id A UUID providing a universally-unique identifier for the entity.
name The name of the dive config.
ship_config Stores the name of the ship configuration during the dive.
sub_config Stores the name of the submersible configuration during the dive.
ship_instrument_configs Stores the names of the instruments on the ship during the dive.
sub_instrument_configs Stores the names of the instruments on the sub during the dive.
note A note about the dive config.
active Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
id
created_on The date and time of creation of the entity.
updated_on The date and time of the entity's last update.

dives

Stores information about each dive.

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

equipconfig

Stores configurations for equipment, including instruments and platforms.

Column Comment
row_id A UUID providing a universally-unique identifier for the entity.
name The name of the equipment config.
short_code A short, easy-to-use identifier for the configuration.
type The type of equipment.
configuration A JSON object containing configuration properties.
note A note about the equipment config.
active Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
id
created_on The date and time of creation of the entity.
updated_on The date and time of the entity's last update.

equipment

Stores equipment, including instruments and platforms.

Column Comment
row_id A UUID providing a universally-unique identifier for the entity.
short_code The short code for the equipment as used in the ROV database equipment table.
brand The brand name of the equipment.
model The model name of the equipment.
serial_number The serial number.
type The type of equipment.
note A note about the equipment.
instrument_id The ID of the instrument in the ROV database. Mutually exclusive with platform_id.
platform_id The ID of the platform in the ROV database. Mutually exclusive with instrument_id.
short_code_mapped 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.
active Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
id
created_on The date and time of creation of the entity.
updated_on The date and time of the entity's last update.

people

Stores the people who worked on the cruise.

Column Comment
row_id A UUID providing a universally-unique identifier for the entity.
initials The initials. Used like a short code for the person.
first_name The first name.
last_name The last name.
email The email address.
person_id The ID of the person in the ROV database.
active Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
id
created_on The date and time of creation of the entity.
updated_on The date and time of the entity's last update.

transects

Stores information about each transect.

Column Comment
row_id A UUID providing a universally-unique identifier for the entity.
cruise_name The name of the cruise.
leg The leg of the cruise.
dive_name The name of the dive.
name The name of the transect.
start_time The time of transect start.
end_time The time of transect ending.
objective The objective of the transect.
summary A summary of the transect, its accomplishments, problems, etc.
note A note about the transect.
active Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
hide True if the entity should be hidden in the UI.
id
created_on The date and time of creation of the entity.
updated_on The date and time of the entity's last update.


Schema: public

The default schema used for system tables and tables installed by application frameworks such as Django, Celery and Knox. These are generally not documented.

Tables

auth_group

A Django table for authorization groups.

Column Comment
id
name

auth_group_permissions

A Django table for permissions on authorization groups.

Column Comment
id
group_id
permission_id

auth_permission

A Django table for available permissions.

Column Comment
id
name
content_type_id
codename

auth_user

A Django table for users.

Column Comment
id
password
last_login
is_superuser
first_name
last_name
email
is_staff
is_active
date_joined
biigle_username
biigle_api_key
organization
org_type
registration_reason
bio
verification_code
verification_expiry
verification_time
registration_ip
ip_in_region
registration_note
allowed
password_reset_code
password_reset_expiry
registration_location

auth_user_groups

A Django table to relate users to groups.

Column Comment
id
user_id
group_id

auth_user_user_permissions

A Django for user permissions.

Column Comment
id
user_id
permission_id

django_admin_log

A Django table for admin logging.

Column Comment
id
action_time
object_id
object_repr
action_flag
change_message
content_type_id
user_id

django_celery_beat_clockedschedule

Column Comment
id
clocked_time

django_celery_beat_crontabschedule

Column Comment
id
minute
hour
day_of_week
day_of_month
month_of_year
timezone

django_celery_beat_intervalschedule

Column Comment
id
every
period

django_celery_beat_periodictask

Column Comment
id
name
task
args
kwargs
queue
exchange
routing_key
expires
enabled
last_run_at
total_run_count
date_changed
description
crontab_id
interval_id
solar_id
one_off
start_time
priority
headers
clocked_id
expire_seconds

django_celery_beat_periodictasks

Column Comment
ident
last_update

django_celery_beat_solarschedule

Column Comment
id
event
latitude
longitude

django_celery_results_chordcounter

Column Comment
id
group_id
sub_tasks
count

django_celery_results_groupresult

Column Comment
id
group_id
date_created
date_done
content_type
content_encoding
result

django_celery_results_taskresult

Column Comment
id
task_id
status
content_type
content_encoding
result
date_done
traceback
meta
task_args
task_kwargs
task_name
worker
date_created
periodic_task_name
date_started

django_content_type

A Django table for content types.

Column Comment
id
app_label
model

django_migrations

Records migrations applied to database.

Column Comment
id
app
name
applied

django_session

Django session management.

Column Comment
session_key
session_data
expire_date

django_site

Column Comment
id
domain
name

event_group

Column Comment
event_id
group_id

knox_authtoken

Column Comment
digest
created
user_id
expiry
token_key

spatial_ref_sys

Column Comment
srid
auth_name
auth_srid
srtext
proj4text

thumbnail_kvstore

Column Comment
key
value


Views

geography_columns

Column Comment
f_table_catalog
f_table_schema
f_table_name
f_geography_column
coord_dimension
srid
type

geometry_columns

Column Comment
f_table_catalog
f_table_schema
f_table_name
f_geometry_column
coord_dimension
srid
type


Functions

get_restricted_events
Return the events that are either unrestricted, or subject to restrictions for which at least one of the user's groups is permitted.
restriction_group_set_admin
When a restriction is inserted, automatically inserts a record into restriction_group group to give admins permission to see the restricted record. Other groups can be added manualy.
trigger_compile_event_restriction_masks
Triggers compilation of restriction masks on the event table when it is updated.
updated_on_column
Updates the updated_on column of a relation to the current time on update.

Procedures

cache_clear_cruise
Clear cached entities associated with the given cruise.
cache_refresh_cruise_stats
Refresh the cruise stats table.
cache_refresh_cruise_track
Stores a linestring representing the path of a platform over the course of a cruise.
cache_refresh_dive_track
Stores a linestring representing the path of a platform over the course of a dive.
cache_refresh_evt_depth
Populates the cache table with depths corresponding to each event. For events that cover a time span, the timestamp and position will be stored as multiple ordered values in the array. For events without an end time a single element will be contained in the array. The boolean parameter, if true truncates the table before rebuilding it.
cache_refresh_evt_measurement
Populates the cache table with measurements corresponding to each event. For events that cover a time span, the timestamp and measurement will be stored as multiple ordered values in the array. For events without an end time a single element will be contained in the array. The boolean parameter, if true
cache_refresh_evt_pos
Populates the cache table with depths corresponding to each event. For events that cover a time span, the timestamp and position will be stored as multiple ordered values in the array. For events without an end time a single element will be contained in the array. If the boolean parameter is true, the table is truncated before rebuilding.
cache_refresh_tables
Calls the cache refresh procedures stored in the cache_table table. These procedures refresh or rebuild cache tables and other tables that need periodic compilation. Each procedure called by this procedure must have a boolean parameter to do with as it chooses. In most cases, the parameter clears or truncates the target table.
cache_refresh_tables
Refreshes all of the cache tables: event positions, event depths, event measurements, dive tracks, transect tracks and cruise tracks.
cache_refresh_transect_track
Stores a linestring representing the path of a platform over the course of a transect.
clean_event_duplicates
Deletes duplicate events over all cruises.
clean_event_duplicates
Deletes duplicate events for the given cruise by checking their time stamps, properties, instrument configs and dive IDs. Loops multiple times to capture multiple duplicates. Deletes duplicate measurements in a separate loop, looking at the type, timestamps, instrument configs and quantity.
clean_measurement_event_duplicates
Deletes duplicate measurment events for a specific cruise.
clean_uploaded_files
Removes uploaded file instances that are not referenced by any other entity. A server-side script must run which deletes files with no corresponding uploaded file record.
compile_event_restrictions
Compiles the event group table which links events to the users whose groups has access to the record based on restriction table
remove_duplicates
Removes duplicated positions, measurements and events (not observations which cannot be deduplicated deterministically).
update_biigle_fov
Finds status events indicating a Laser Point and computes the laser distance in pixels and field of view in centimetres using the annotation points. Creates measurement events and deletes the status events.

Schema: rov

Contains tables related to the imagery annotation (ROV) database.

Tables

abundance

Stores a list of abundance labels from the ACFOR scale.

Column Comment
id
name A descriptive label for the abundance level.
rank 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.
source A source label to distinguish abundance labels with the same names. TODO: Provisional, pending determination of how abundance codes are handled.
note An optional note about the abundance level.
short_code Contains a short code that can be used to look up an abundance (e.g., during import) without relying on the primary key.

annotation_job

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

Column Comment
id
name A name for the annotation project.
objective A statement of the objectives of the annotation project.
note Operational notes about the annotation project.
start_date The starting date of the project.
end_date The ending date of the project.
created_on The date of creation of the entity.
updated_on The date of last modification of the entity.

annotation_job_annotation_protocol

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

Column Comment
id
annotation_job_id The ID of the annotation job.
annotation_protocol_id The ID of the annotation protocol.

annotation_job_crew

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

Column Comment
id
annotation_job_id The ID of the annotation job.
person_id The ID of the crew member.
role_id The ID of the role.

annotation_job_role

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

Column Comment
id
name The name of the role.
note A descript of the role.

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.

Column Comment
id
medium_type_id The type of media used for annotation. Looked up in media type table.
annotation_software_id Software used to annotate the video or images. Looked up in the annotation software table.
name The name of the annotation protocol. Should be unique.
is_template If this is meant to be a template that is copied for use, mark this column `true`.
image_interval The interval between images or frame grabs. Typically 3 to 10 seconds.
image_overlap Is there overlap between the images (true) or do they represent independent non-overlapping space (false).
habitat_only Set to true if only habitat variables were recorded.
species_guide A URL to the iNaturalist species guide that was used for annotation.
note 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.
created_on The date of creation of this record.
updated_on The date of update of this record.
creator_id Records the identity of the person who created this protocol.
invertebrate_species Whether all invertebrate species are identified: "all", "subset" or "none".
fish_species Whether all fish species are identified: "all", "subset" or "none".
algae_species Whether all algae species are identified: "all", "subset" or "none".
biogenic_habitat True if any habitat categories include fauna (e.g., sponge reefs).
protocol_document Link, title, DOI, etc. of a document describing the protocol in full.
observation_interval The time interval between species or anthropogenic observations.
habitat_interval The time interval between habitat observations.
fov_interval The time interval between field-of-view measurements.
image_interval_unit A unit for the image interval, such as 's' for seconds or 'm' for metres.
observation_interval_unit A unit for the observation interval, such as 's' for seconds or 'm' for metres.
habitat_interval_unit A unit for the habitat interval, such as 's' for seconds or 'm' for metres.
fov_interval_unit A unit for the field of view interval, such as 's' for seconds or 'm' for metres.

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.

Column Comment
id
annotation_protocol_id A reference to the annotation protocol.
note An optional note about the document.
title The title of the document.
url An optional URL for the document. If file data are not given, this field is required.
created_on The time of creation of the record.
updated_on The time of update of the record.
file_id A reference to the uploaded file.

annotation_software

The software used for annotation.

Column Comment
id
name The name of the annotation software.
note An optional note about the annotation software.

biigle_label_map

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

Column Comment
id
label_tree_id The ID of the Biigle label tree.
label_id The ID of the Biigle label.
label_hierarchy The full hierarchical text of the Biigle label.
label_text The text of the final element of the label.
properties Stores the properties of the observation.
note A textual note or comment.
created_on The time of creation of the record.
updated_on Time of last update of the record.

biigle_label_map_restriction

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

Column Comment
id
restriction_id A link to the restriction.
biigle_label_map_id A link to the label map.

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.

Column Comment
id
name The name of the biocover.
note An optional description of the biocover.
short_code Contains a short code that can be used to look up a biocover (e.g., during import) without relying on the primary key.

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.

Column Comment
id
name The name of the complexity type.
note An optional description of the complexity type.
short_code Contains a short code that can be used to look up a complexity (e.g., during import) without relying on the primary key.

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.

Column Comment
id
name A characterization of percent coverage. Presented as a range of percentages.
minimum The minimum value in the range.
maximum The minimum value in the range.
note An optional note about the coverage percentage.
short_code Contains a short code that can be used to look up a coverage (e.g., during import) without relying on the primary key.

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.

Column Comment
id
name A name for this leg of the cruise.
objective A statement of the operational or scientific objectives of the cruise.
start_time The start time of the leg.
end_time The end time of the leg.
planned_track A multilinestring containing the planned track of the leg. TODO: Not known whether this is necessary.
note Notes about the cruise.
created_on The date of creation of this record.
updated_on The date of update of this record.
leg Cruise legs are numbered from 1.
summary A summary of the cruise, with information about whether the objectives were met and any other pertinent information.
approved 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.
ship_id The ID of the ship used on this cruise.
admin_note Notes by the database administrator about this entity.
mark_for_delete Marks the entity for asynchronous deletion by the runner.

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.

Column Comment
id
cruise_id Reference to the cruise leg to which the member is assigned.
person_id Reference to the person on the crew.
cruise_role_id Reference to the cruise role.
note An optional note about the crew member.

cruise_document

Stores information about documents related to a cruise.

Column Comment
id
cruise_id The ID of the cruise.
note A note about the document.
title The title of the document.
url A URL for the online copy of the document. May be used when no file is available.
created_on The date and time of creation of the entity.
updated_on The date and time of the entity's last update.
file_id

cruise_fn_contact

A table for associating First Nations contacts with a cruise.

Column Comment
id
cruise_id A reference to the cruise.
contact_name The full name of the contact.
email The email address of the contact.
phone The phone number of the contact.
nation The name of the nation or group represented by the contact.
note A note about the contact.

cruise_import

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

Column Comment
id
name A unique name for the import job.
data A JSON document containing the cruise import data.
status A status message about processing.
logs A JSON array containing the complete processing log.
created_on
updated_on
version
task_id Stores the task ID for the asychrnonous task (i.e., a Celery task) used to process the import.

cruise_program

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

Column Comment
id
cruise_id The ID of a cruise.
program_id The ID of a program.

cruise_role

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

Column Comment
id
name The name of the role.
note An optional note about the role and its responsibilities.
short_code A short string used to identify the role.

disturbance

Provides a nominal level of disturbance for habitat events.

Column Comment
id
name The textual representation of the disturbance level.
note A note about the disturbance level.
short_code Contains a short code that can be used to look up a disturbance (e.g., during import) without relying on the primary key.

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.

Column Comment
id
cruise_id A reference to the cruise leg during which the dive was performed.
name A name for the dive.
objective A statement of the practical or research objectives for this dive.
start_time The start of the dive. Not necessarily the time the vehicle is placed in the water.
end_time The end of the dive.
note An optional note about the dive.
attributes A JSON column used for recording structured attributes that do not fit with the regular table structure.
created_on The date of creation of this record.
updated_on The date of update of this record.
summary A summary of the dive; whether objectives were met, problems encountered, etc.
sub_config_id A reference to the platform config for the submersible or ROV.
ship_config_id A reference to the platform config for the ship.
admin_note
seatube_id The ID of a dive on SeaTube corresponding to this dive.
mark_for_delete Marks the entity for asynchronous deletion by the runner.
site An optional name for the site.

dive_crew

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

Column Comment
id
dive_id The dive to which the crew member is assigned.
person_id A reference to the person.
dive_role_id A reference to the dive role.
note An optional note about the crew member.

dive_role

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

Column Comment
id
name The name of the role.
note An optional description of the role.
short_code A short string used to identify the role.

equipment_type

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

Column Comment
id
name A name for the equipment type.
note An optional note about the equipment type.
category An enumeration column identifying the equipment as platform, instrument or some other type.

event

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

Column Comment
id
dive_id A reference to the dive during which this event occurred.
annotation_job_id
instrument_config_id
start_time The start time of the event.
end_time The end time of the event. Null, if the event is discrete.
properties A JSON object containing name-value pairs describing the event.
note An optional note about the event. Do not use to store event data.
created_on The time of creation of the event.
updated_on The time of update of the event. Automatically updated by a trigger.
hidden If true, the entity should be hidden from searches and reports. An alternative to deleting entities that may prove useful in the future.
import_group_id A reference to the import group, which tracks events which were imported at the same time, from the same file.

event_group

Links the event table to the group table to facilitate the restriction mechanism.

Column Comment
event_id Links to the event table.
group_id Links to the group table.

event_logger

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

Column Comment
id
person_id A person who contributed to the annotation.
event_id The event that was created from the annotation(s).

flow

Stores categories of current flow for habitat.

Column Comment
id
name A note about the flow category.
note
short_code A short code for the flow category.

generic_label_map

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

Column Comment
id
label_text The text of the label.
properties A dictionary of mapped properties.
note A note about the mapping.
created_on The date of creation.
updated_on The date of last update.

generic_label_map_restriction

Links a generic label mapping to a restriction.

Column Comment
id
restriction_id A reference to a restriction.
generic_label_map_id A reference to a generic label mapping.

image_quality

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

Column Comment
id
name A name for the quality level.
rank An ordinal rank (zero is high) for the quality level.
note An optional note.
short_code Contains a short code that can be used to look up an image quality (e.g., during import) without relying on the primary key.

import_group

Stores information about a group of measurements, positions or events so they can be distinguished by when or from what file they were imported. This provides the ability to delete a single stream of data at a finer resolution that just the instrument config, platform config, dive, etc. The initial entries in the table are created retroactively, and contain undifferentiated records based on the instrument config and measurement type (measurements); the instrument config (positions) or the dive and instrument config (events).

Column Comment
id
name A name for the import or the name of the file from which the data were imported.
note
created_on The date and time that the import was initiated.
source_file

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.

Column Comment
id
user_id A reference to the MSEA user that created the record.
note An optional note about the import package.
created_on The date of creation of the record.
updated_on The date of update of the record.
name A unique name for the import queue record.
status A short description of the processing status of the job.
cruise_name 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 Stores the JSON representation of the import job.
hidden
objective
start_date
end_date

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.

Column Comment
id
tags The list of tags.
properties The the tag data.
created_on The date and time of creation of the entity.
updated_on The date and time of the entity's last update.
name The text of the label.
label_tree_name The label tree name. If given identifies the label uniquely with the tree name.
event_type

import_queue_pi

Stores the import packages created by principal investigators.

Column Comment
id
user_id A reference to the MSEA user that created the record.
name A name of the import job
note An optional note about the import package.
status A short description of the processing status of the job.
created_on The date of creation of the record.
updated_on The date of update of the record.
cruise_id A reference to the cruise.
hidden

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.

Column Comment
id
model_id A reference to the instrument model.
serial_number 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.
retired If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active.
attributes A freeform list of attributes for this instrument.
note An optional note about this instrument.
created_on The date of creation of this record.
updated_on The date of update of this record.
organisation_id A reference to the organisation that owns and operates the instrument.
name A name for the instrument to distinguish it from others of the same model.

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.

Column Comment
id
configuration Configuration information about the instrument config.
note An optional note about this configuration.
created_on The date of creation of this record.
updated_on The date of update of this record.
platform_config_id The ID of the platform upon which the instrument is used.
instrument_id Reference to the instrument targeted by the configuration.
mark_for_delete Marks the entity for asynchronous deletion by the runner.

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.

Column Comment
id
measurement_type_id A reference to the type of this measurement.
timestamp The time that the measurement was recorded.
quantity The scalar quantity or magnitude of the measurement.
signal_quality A quality of the measurement as reported by the instrument. TODO: Requires clarification.
is_modelled A flag to indicate whether the value is derived from measurements by some modelling process.
instrument_config_id The configured instrument used to generate this item.
import_group_id A reference to the import group, which tracks measurements which were imported at the same time, from the same file.

measurement_type

This is a lookup table of types of measurement types for the measurement table. 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.

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

medium_format

A lookup table for data formats. This will include things like video, photo and acoustic. Medium formats can be discriminated as granularly as desired: as video/photo/acoustic/etc. or by format (JPG, MP4, AAC) and possibly more specific encoding parameters.

Column Comment
id
medium_type_id A reference to the medium type (e.g., video or photo).
name The name of the format.
extensions 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 An optional note about the format.
short_code Contains a short code that can be used to look up a medium format (e.g., during import) without relying on the primary key.

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.

Column Comment
id
name The name of the media type.
note An optional note about the media type.
short_code Provides a short code for looking up the entity.

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.

Column Comment
id
brand_name The brand name.
model_name The model name.
attributes A free-form JSON field for attributes of this model.
note An optional note about the model.
equipment_type_id A reference to the equipment type.

observation_confidence

Provides a nominal observation confidence level for observation events.

Column Comment
id
name The textual representation of the confidence level.
rank This field is a way of ranking confidence levels so that an ordering can be established.
note A note about the confidence level.
short_code Contains a short code that can be used to look up a observation confidence (e.g., during import) without relying on the primary key.

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.

Column Comment
id
orientation_type_id A reference to the orientation type of this orientation.
timestamp The time the position was recorded.
orientation The orientation vector.
signal_quality The signal quality of the position as reported by the instrument. TODO: Requires clarification.
is_modelled A flag to indicate whether the value is derived from measurements by some modelling process.
instrument_config_id The configured instrument used to generate this item.

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.

Column Comment
id
name The name of the orientation type (e.g., "Quaternion").
unit The units used to interpret the elements of the vector.
note An optional note about the orientation type.
short_code Contains a short code that can be used to look up an orientation type (e.g., during import) without relying on the primary key.

platform

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

Column Comment
id
model_id A reference to the model of the platform.
name 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.
serial_number 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.
retired If the platform is retired, this records the date. If null, the platform is assumed to be active.
attributes A freeform list of attributes for this platform.
note An optional note about this platform.
created_on The date of creation of this record.
updated_on The date of update of this record.
short_code Contains a short code that can be used to look up a platform (e.g., during import) without relying on the primary key.
organisation_id A reference to the organisation that owns and operates the platform.

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.

Column Comment
id
platform_id A reference to the platform.
configuration The configuration data as a JSON object.
note An optional note about the configuration record.
created_on The date of creation of this record.
updated_on The date of update of this record.
mark_for_delete Marks the entity for asynchronous deletion by the runner.

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?

Column Comment
id
position_type_id A reference to the position type of this position.
timestamp The time the position was recorded.
signal_quality The signal quality of the position as reported by the instrument. TODO: Requires clarification.
geom The point geometry.
is_modelled A flag to indicate whether the value is derived from measurements by some modelling process.
instrument_config_id The configured instrument used to generate this item.
import_group_id A reference to the import group, which tracks positions which were imported at the same time, from the same file.

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.

Column Comment
id
name The name of the position type. E.g., "Geographic" or "Yaw, Pitch, Roll."
unit The unit. Linear or angular. E.g., "m" or "radians."
note An optional note about this position type.
short_code Contains a short code that can be used to look up a position type (e.g., during import) without relying on the primary key.

program

This is a listing of scientific or other programs that can be associated with cruises.

Column Comment
id
name The name of the program.
objective The objective or mandate of the program.
start_date The starting date of the program.
end_date The optional end date of the program.
note An optional note about the program.
created_on The date of creation of this item.
updated_on The date of update of this record.
summary A summary of the program; whether objectives were met, problems encountered, etc.

program_member

Assigns user roles to a program.

Column Comment
id
program_id The reference to the program.
person_id A reference to the person.
role_id A reference to the program role.

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.

Column Comment
id
name The name of the role. E.g., "Chief Scientist."
note An optional note about the role.

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.

Column Comment
id
name A name for the survey protocol.
note An optional note about the protocol.
short_code Contains a short code that can be used to look up a survey protocol (e.g., during import) without relying on the primary key.

relief

Provides a nominal level of terrain relief for habitat events.

Column Comment
id
name The textual representation of the relief level.
note A note about the relief level.
short_code Contains a short code that can be used to look up a relief (e.g., during import) without relying on the primary key.

signup_area

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

Column Comment
id
name The name of the sign-up region.
geom The geometry of the sign-up region.

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.

Column Comment
id
name The name of the status event.
note An optional description of the status type.
short_code A short code for referencing the status type in import documents.

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.

Column Comment
id
status_type_id A reference to the status type.
name 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 Optional extended description of detail.
short_code 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.

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.

Column Comment
id
name The name of the substrate.
note An optional description of the substrate.
short_code Contains a short code that can be used to look up a substrate (e.g., during import) without relying on the primary key.

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.

Column Comment
id
name The name of the survey mode.
note An optional note about the survey mode.
short_code Contains a short code that can be used to look up a survey mode (e.g., during import) without relying on the primary key.

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.

Column Comment
id
name A characterization of biocover thickness.
minimum The minimum value in the range.
maximum The maximum value in the range.
note An optional note about the biocover thickness.
short_code Contains a short code that can be used to look up a thickness (e.g., during import) without relying on the primary key.

transect

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

Column Comment
id
dive_id A reference to the dive during which this transect occurred.
name The name of the transect.
objective A statement of the practical or research objectives for this true.
start_time The start time of the transect.
end_time The end time of the transect.
note An optional note about the transect.
attributes A JSON column used for recording structured attributes that do not fit with the regular table structure.
summary A summary of the transect; whether objectives were met, problems encountered, etc.
admin_note

weather_observation

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

Column Comment
id
cruise_crew_id A reference to the cruise leg crew member who is making the report.
temperature The air temperature.
pressure The air pressure.
wind_speed The wind speed.
wind_direction The wind direction.
swell Description of swell.
time An optional note about the weather.
note An optional note about the observation
cruise_id A link to the cruise during which this record was recorded.


Schema: shared

Contains tables that support all applications on the server, such as the "person" table, which provides personnel lists.

Tables

db_version

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

Column Comment
id
version_major The major version.
version_minor The minor version number.
updated_on The time the upgrade was performed.
revision The revision number.

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.

Column Comment
id
file_type_id An optional reference to the file type.
name The name for the file.
description An optional description for the file.
metadata A JSON dictionary containing metadata relating to the file.
path A path of the file, relative to the root directory where files are stored.
created_on The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
updated_on The update time of the file record, not necessarily the file itself (this should be stored in metadata).
hash And MD5 hash of the file data. Used to compare files and search for identical versions.
blob_url 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.

file_type

A list of file types.

Column Comment
id
name The name of the file type.
short_code A short code for referencing the file type in import documents.

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.

Column Comment
id
user_id A reference to the Django user.
biigle_username The Biigle username.
biigle_api_key The Biigle API key.
pg_role The name of the PostgreSQL role that the user will use to log in directly to the database.
organization The organization with which a user is affiliated.
org_type The the type of organization with which the user is affiliated.
registration_reason A short note about why the user registered.
bio Biographical information about the user.
verification_code An auto-generated string used to identify the user for verification purposes.
verification_expiry The time of expiration of the verification code.
verification_time The date and time at which the user was verified.
registration_ip The IP used by the user to register.
ip_in_region Set to true if the user's IP is within the signup region. False positives and negatives are possible.
registration_note Administrator notes about the user's registration status.
allowed 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.

organisation

Convenient storage for organisations involved in MSEA activities.

Column Comment
id
name The full name of the organisation.
country The code for the country where the organisation is based (e.g., "CA" for Canada).
note An optional note about the organisation.

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.

Column Comment
id
biigle_user_id The Biigle database ID of a user. The UUID should be used instead.
first_name First name.
last_name Last name.
email Email address.
photo A photo of the person.
bio A brief biography of the person.
biigle_uuid The Biigle UUID is used to identify the user in Biigle apps.
affiliation The organization with which this user is currently affiliated.

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.

Column Comment
id
name The name of the restriction.
key The top-level property name or key.
pattern 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'.
note An optional note about the restriction.
created_on The date of creation of the restriction.
updated_on The date of last update of the restriction.

restriction_group

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

Column Comment
id
restriction_id The ID of the restriction.
group_id The ID of the Django authentication group.

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.

Column Comment
id
spatial_library_id A reference to the spatial library entry.
name A name for the site.
note An optional note about the site.

spatial_library

Maintains a library of spatial data.

Column Comment
id
file_id A reference to a related file.
name A name for the entry.
note A note about this library item.
thumbnail A small thumbnail in binary (JPG) form.
created_on The time when this record was created.
updated_on The date of update of this record.
geom A vector representation of the object(s), projected into WGS84 (lat/lon) and stored as a geography type.
metadata A JSON object containing metadata related to the spatial object.
rast A raster.

spatial_library_file

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

Column Comment
id
spatial_library_id A link to the spatial library.
file_id A link to the file.

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.

Column Comment
id
path The path to the temporary location of the file.
type The guessed MIME type of the file.
name The original name of the file.
created_on The time of creation of the record.
expires_on The expiry time of the file. It may be deleted by a maintenance script after this time.
marked_for_delete If true, the file is marked for delete. Otherwise it will not be touched unless there is an age limit set in the daemon.


Schema: taxonomy

Contains taxonomic information from a variety of sources including WoRMS, iNaturalist and the Hart list used by DFO.

Tables

taxon

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

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