Annotation Database Entity Documentation: Difference between revisions

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


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,
= Notes About Specific Entities =


    COMMENT ON TABLE [schema].[table name] IS 'This is a table comment.'
These notes about specific entities complement the generated documentation below.
    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.
== [[#rov.dive|rov.dive]] and [[#rov.transect|rov.transect]] ==


= Generating Documentation =
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.


Database entity documentation is generated from the production database by the script, [https://gitlab.com/rskelly/msea-rov-db/-/blob/main/model/db_extract_docs.py db_extract_docs.py].
Transects are defined by their start and end times, contained entirely within dives and do not cross the boundaries between dives. They do not have any related entities and function mainly as accounting items. However, they are extremely important in the analysis of observations and measurements collected during the dive. For example, if one is calculating the density of a particular population of organisms, one must know the precise geographic extent of the region. Transects accomplish this and store objectives and operational notes.


The documentation is arranged into conceptual groupings with the following structure.  
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).


* Grouping
= Generated Documentation =
** Schema
*** Table
*** Materialized View
*** View


System and Django tables aren't included. The ID column of each table is also excluded.
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 <!-- BEGIN GENERATED CONTENT --> tag.


''Note: the named anchors in the headings are not yet correctly handled by the Markdown processor and cannot be linked.''
The documentation is arranged into conceptual groupings with the following structure.  


== Groups ==
* Schema
** Table
** Materialized View
** View


<!-- BEGIN GENERATED CONTENT -->
System and Django tables aren't included. The ID column of each table is also excluded.
<markdown>


### Shared
== Database Comments ==


These are shared tables used by other tables in other schemas.
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,


#### Schema: shared
    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.'


##### Table: db_version <a name="shared.db_version"></a>
Comments are managed using DDL, as described on the [[Annotation_Database#Database_Upgrades|Database Upgrades]] page.


Stores the current database version so that upgrade scripts can perform migrations appropriately.
== Generated Entity Documentation ==


| Column Name | Type | Not Null | Default | Description |
''Note: this page is auto-generated from the documentation comments in the actual database. Do not edit it directly.''
| --- | --- | --- | --- | --- |
| revision | int4 | False | None | The revision number. |
| updated_on | timestamp | False | None | The time the upgrade was performed. |
| version_major | int4 | False | None | The major version. |
| version_minor | int4 | False | None | The minor version number. |


##### Table: file <a name="shared.file"></a>  
<!-- BEGIN GENERATED CONTENT -->
<span id="intertidal"></span>
== Schema: intertidal ==


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 data for the intertidal database. Contains information about UAS flights, surveys and other derivative data.


| Column Name | Type | Not Null | Default | Description |
<span id="intertidal.quadrat"></span>
| --- | --- | --- | --- | --- |
=== Table: quadrat ===
| blob_url | varchar | False | None | A URL referencing the file in online blob storage. This field is subject to change depending on where the files reside and will change if they're moved. |
| created_on | timestamp | False | None | The creation time of the file record, not necessarily the file itself (this should be stored in metadata). |
| description | text | False | None | An optional description for the file. |
| file_type_id | int4 | False | None | An optional reference to the [file type](#shared.file_type). |
| hash | varchar | False | None | And MD5 hash of the file data. Used to compare files and search for identical versions. |
| metadata | jsonb | False | None | A JSON dictionary containing metadata relating to the file. |
| name | varchar | False | None | The name for the file. |
| path | varchar | False | None | A path of the file, relative to the root directory where files are stored. |
| updated_on | timestamp | False | None | The update time of the file record, not necessarily the file itself (this should be stored in metadata). |


##### Table: file_type <a name="shared.file_type"></a>
A record of observations within an intertidal quadrat.


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


| Column Name | Type | Not Null | Default | Description |
<span id="intertidal.quadrat_observation"></span>
| --- | --- | --- | --- | --- |
=== Table: quadrat_observation ===
| name | varchar | False | None | The name of the file type. |
| short_code | varchar | False | None | A short code for referencing the file type in import documents. |


##### Table: hart_taxon <a name="shared.hart_taxon"></a>
Records observations within [[#intertidal.quadrat|quadrats]]. The observation type enumeration is defined in the database export panel.


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 [taxon](#shared.taxon) table, and it serves as a metadata table for records stored there.
{| class="wikitable"
|+ Columns in "quadrat_observation"
|-
! Name !! Type !! Nullable !! Documentation
|-
| cell || integer || YES || The quadrat cell, typically from 0 - 100.
|-
| count || integer || YES || The number of organisms observed.
|-
| coverage || real || YES || The percent coverage by the organism, 0-100. TODO: Not part of the specification.
|-
| length || real || YES || The measured length of an organism.
|-
| quadrat_id || integer || NO || A link to the [[#intertidal.quadrat|quadrat]].
|-
| surveytaxon_id || integer || NO || A link to the [[#intertidal.survey_taxon|survey taxon]].
|-
| type || integer || YES || The type of observation; one of quadrat_obs_type.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="intertidal.quadrat_substrate"></span>
| --- | --- | --- | --- | --- |
=== Table: quadrat_substrate ===
| authority | text | False | None | The identification authority. |
| common_name | varchar | False | None | The common name. |
| from_date | date | False | None | ? |
| grouping_id | int4 | False | None | The grouping. * B - Bird * F - Fish * I - Invertebrate * M - Mammal * O - Object? * R - Reptile |
| latin_name | varchar | False | None | The Latin name of the item, which is distinct in this table from the scientific name. Appears to be informal, and not necessarily Latin. |
| nodc_code_v7 | float4 | False | None | The NODC code, v7. |
| nodc_code_v8 | int4 | False | None | The NODC code, V8. Identical to the ITIS ID. |
| rank_id | int4 | False | None | A three-letter code indicating the taxonomic level. |
| scientific_name | varchar | False | None | The scientific (e.g., Linnean) name. |
| sp_species_code | varchar | False | None | Another species code whose purpose/origin is not known. |
| species_code | varchar | False | None | The species, or Hart, code. |
| species_prov_code | varchar | False | None | ? |
| taxa_reference | text | False | None | The reference for the identification. |
| to_date | date | False | None | ? |


##### Table: library <a name="shared.library"></a>
List substrates observed in intertidal quadrats.


This table stores a partial record of documents, books and papers that can be referenced by other entities. The ISBN and DOI fields are set to unique, but these may vary (in representation, at least) for a single document so care should be taken not to add duplicates. However, updated papers with the same title and author, but different date, are not disallowed.
{| class="wikitable"
|+ Columns in "quadrat_substrate"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the substrate.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="intertidal.quadrat_substrate_coverage"></span>
| --- | --- | --- | --- | --- |
=== Table: quadrat_substrate_coverage ===
| abstract | text | False | None | The abstract of the entry. |
| authors | jsonb | False | None | The (list of) author(s) of the document. This is a JSON list of objects containing whatever information is necessary. Authors should be listed with at least first_name and last_name, and any other relevant information, such as email or institution. |
| created_on | timestamp | False | None | The creation time of the file record, not necessarily the file itself (this should be stored in metadata). |
| doi | varchar | False | None | The DOI of the document. |
| file_id | int4 | False | None | An optional reference to a [file](#shared.file). |
| institution | varchar | False | None | The name of the institution or publisher responsible for the document. |
| isbn | varchar | False | None | The ISBN of the book, if it is a book. |
| issn | varchar | False | None | The ISSN of the entry. |
| keywords | jsonb | False | None | A list of keywords relating to the entry. |
| mendeley_id | varchar | False | None | The ID of the record in Mendeley. |
| publication | varchar | False | None | The name of the publication in which the document appeared. |
| title | text | False | None | The title of the book, paper, or other document. |
| type | varchar | False | None | Describes the type of entry: book, article, etc. |
| updated_on | timestamp | False | None | The update time of the file record, not necessarily the file itself (this should be stored in metadata). |
| year | varchar | False | None | The publishing date of the document. |


##### Table: mseauser <a name="shared.mseauser"></a>
Associates [[#intertidal.quadrat_substrate|quadrat substrate]] coverages with [[#intertidal.quadrats|quadrats]].


Represents an MSEA user and is linked to a single Django auth User. Stores extra application-related properties such as the Biigle API key.
{| class="wikitable"
|+ Columns in "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]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="intertidal.survey"></span>
| --- | --- | --- | --- | --- |
=== Table: survey ===
| biigle_api_key | varchar | False | None | The Biigle API key. |
| biigle_username | varchar | False | None | The Biigle username. |
| pg_role | varchar | False | None | The name of the PostgreSQL role that the user will use to log in directly to the database. |
| user_id | int4 | False | None | A reference to the [Django user](#public.auth_user). |


##### Table: mseauser_restriction <a name="shared.mseauser_restriction"></a>
Stores metadata about intertidal surveys.


Links an [MSEA user](#shared.mseauser) to a [restriction](#shared.restriction). The user will have access to records related to this group.
{| class="wikitable"
|+ Columns in "survey"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || The time of creation of this record.
|-
| end_date || timestamp without time zone || YES || The end date of the survey.
|-
| name || character varying || NO || The name of the survey.
|-
| note || text || YES || Notes about the survey.
|-
| objective || text || YES || The survey objective.
|-
| site_id || integer || YES || Relates the survey to a [[#shared.site|site]] entity.
|-
| start_date || timestamp without time zone || NO || The start date of the survey.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="intertidal.survey_crew"></span>
| --- | --- | --- | --- | --- |
=== Table: survey_crew ===
| created_on | timestamp | False | None | The creation time of the record. |
| mseauser_id | int4 | False | None | The ID of the [MSEA user](#shared.mseauser). |
| restriction_id | int4 | False | None | The ID of the [restriction](#shared.restriction). |
| updated_on | timestamp | False | None | The last update time of the record. |


##### Table: news_item <a name="shared.news_item"></a>
Associates [[#intertidal.survey|intertidal survey]] crew members with [[#intertidal.survey_role|roles]].


A table for news items related to each sub-site.
{| class="wikitable"
|+ Columns in "survey_crew"
|-
! Name !! Type !! Nullable !! Documentation
|-
| note || text || YES || An optional note about the survey role.
|-
| person_id || integer || NO || A reference to the person with this [[#shared.person|role]].
|-
| role_id || integer || NO || A reference to the [[#intertidal.survey_role|role]].
|-
| survey_id || integer || NO || A reference to the [[#intertidal.survey|survey]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="intertidal.survey_role"></span>
| --- | --- | --- | --- | --- |
=== Table: survey_role ===
| content | text | False | None | The content of the item. |
| created_on | timestamp | False | None | The date of creation of the item. |
| sites | varchar | False | None | An optional comma-delimited list of sites the item refers to. The current list is 'rca', 'rov', 'intertidal'. Leave empty to apply to all sites. TODO: Currently not standardized or enforced. |
| title | varchar | False | None | A title for the item. |


##### Table: organisation <a name="shared.organisation"></a>
A list of roles available to [[#intertidal.survey_crew|intertidal survey crew members]].


Convenient storage for organisations involved in MSEA activities.
{| class="wikitable"
|+ Columns in "survey_role"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the role.
|-
| note || text || YES || A note about the role.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="intertidal.survey_taxon"></span>
| --- | --- | --- | --- | --- |
=== Table: survey_taxon ===
| country | varchar | False | None | The code for the country where the organisation is based (e.g., "CA" for Canada). |
| name | varchar | False | None | The full name of the organisation. |
| note | text | False | None | An optional note about the organisation. |
| short_code | varchar | False | None | A short code for looking up the entity; usually the organisation's acronym. |


##### Table: person <a name="shared.person"></a>
Links [[#shared.taxon|taxon]] records to [[#intertidal.survey|intertidal surveys]].


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 "survey_taxon"
|-
! Name !! Type !! Nullable !! Documentation
|-
| survey_id || integer || NO || A link to the [[#intertidal.survey|survey]].
|-
| taxon_id || integer || NO || A link to the [[#shared.taxon|taxon]] record.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="ndst"></span>
| --- | --- | --- | --- | --- |
== Schema: ndst ==
| biigle_user_id | int4 | False | None | The Biigle database ID of a user. The UUID should be used instead. |
| biigle_uuid | bpchar | False | None | The Biigle UUID is used to identify the user in Biigle apps. |
| bio | text | False | None | A brief biography of the person. |
| email | varchar | False | None | Email address. |
| first_name | varchar | False | None | First name. |
| last_name | varchar | False | None | Last name. |
| photo | bytea | False | None | A photo of the person. |


##### Table: restriction <a name="shared.restriction"></a>
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.


Provides a list of restrictions that can be applied to individual observation rows, to restrict access to allowed roles.
<span id="ndst.cruise"></span>
=== Table: cruise ===


| Column Name | Type | Not Null | Default | Description |
Contains information about a cruise, as entered by NDST staff. Will be combined with other data to populate the [[#rov.cruise|cruise]] table.
| --- | --- | --- | --- | --- |
| created_on | timestamp | False | None | The creation time of the restriction. |
| name | varchar | False | None | The name of the restriction. |
| note | text | False | None | An optional note about the restriction. |
| short_code | varchar | False | None | A short code used to reference the restriction. |
| updated_on | timestamp | False | None | The last update time of the restriction. |


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


Contains the names and geographic boundaries of study sites. This will be useful not only for mapping but for querying data by spatial extent.
<span id="ndst.diveconfig"></span>
=== Table: diveconfig ===


| Column Name | Type | Not Null | Default | Description |
Stores configurations for each dive, including the submersible, ship and any instruments on either.
| --- | --- | --- | --- | --- |
| name | varchar | False | None | A name for the site. |
| note | text | False | None | An optional note about the site. |
| spatial_library_id | int4 | False | None | A reference to the [spatial library](#shared.spatial_library) entry. |


##### Table: spatial_library <a name="shared.spatial_library"></a>
{| class="wikitable"
|+ Columns in "diveconfig"
|-
! Name !! Type !! Nullable !! Documentation
|-
| active || boolean || NO || Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
|-
| name || text || YES || The name of the dive config.
|-
| note || text || YES || A note about the dive config.
|-
| row_id || text || YES || A UUID providing a universally-unique identifier for the entity.
|-
| ship_config || text || YES || Stores the name of the [[#ndst.equipconfig|ship configuration]] during the dive.
|-
| ship_instrument_configs || text || YES || Stores the names of the [[#ndst.equipconfig|instruments]] on the ship during the dive.
|-
| sub_config || text || YES || Stores the name of the [[#ndst.equipconfig|submersible configuration]] during the dive.
|-
| sub_instrument_configs || text || YES || Stores the names of the [[#ndst.equipconfig|instruments]] on the sub during the dive.
|-
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|}


Maintains a library of spatial data.
<span id="ndst.dives"></span>
=== Table: dives ===


| Column Name | Type | Not Null | Default | Description |
Stores information about each dive.
| --- | --- | --- | --- | --- |
| created_on | timestamp | False | None | The time when this record was created. |
| file_id | int4 | False | None | A reference to a related [file](#shared.file). |
| geom | geography | False | None | A vector representation of the object(s), projected into WGS84 (lat/lon) and stored as a geography type. |
| metadata | jsonb | False | None | A JSON object containing metadata related to the spatial object. |
| name | varchar | False | None | A name for the entry. |
| note | text | False | None | A note about this library item. |
| rast | bytea | False | None | A raster. |
| thumbnail | bytea | False | None | A small thumbnail in binary (JPG) form. |
| updated_on | timestamp | False | None | The date of update of this record. |


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


Allows a [spatial library](#shared.spatial_library) entity to own more than one file.
<span id="ndst.equipconfig"></span>
=== Table: equipconfig ===


| Column Name | Type | Not Null | Default | Description |
Stores configurations for [[#ndst.equipment|equipment]], including instruments and platforms.
| --- | --- | --- | --- | --- |
| file_id | int4 | False | None | A link to the [file](#shared.file). |
| spatial_library_id | int4 | False | None | A link to the [spatial library](#shared.spatial_library). |


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


A table of suggestions supplied by users for upgrades to the database.
<span id="ndst.equipment"></span>
=== Table: equipment ===


| Column Name | Type | Not Null | Default | Description |
Stores equipment, including instruments and platforms.
| --- | --- | --- | --- | --- |
| created_on | timestamp | False | None |  |
| down_votes | int4 | False | None | A count of the down votes on the suggestion. |
| email | varchar | False | None | The email of the suggesting user. |
| screen_name | varchar | False | None | A screen name for the suggesting user. |
| suggestion | text | False | None | The text of the suggestion. |
| up_votes | int4 | False | None | A count of the up votes on the suggestion. |


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


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.
<span id="ndst.people"></span>
=== Table: people ===


| Column Name | Type | Not Null | Default | Description |
Stores the people who worked on the [[#ndst.cruise|cruise]].
| --- | --- | --- | --- | --- |
| aphia_id | int4 | False | None | A reference to the [WoRMs](https://www.marinespecies.org/) database. The actual Aphia ID used by WoRMs is used as the primary key in the [WoRMs taxon](#rov.worms_taxon) table. |
| common_name | varchar | False | None | The common name of the taxon. |
| hart_code | varchar | False | None | Used when there's not ref in the hart code table. |
| hart_id | int4 | False | None | A reference to the [Hart code table](#shared.hart_taxon). This is an identification with species used by VideoMiner and other tools that use that list. |
| inaturalist_id | int4 | False | None | A reference to the [iNaturalist](https://www.inaturalist.org/projects/marine-life-of-the-northeast-pacific) taxon. The iNaturalist taxon ID is used as the primary key in the [iNaturalist taxon](#rov.inaturalist_taxon) table. |
| label | varchar | False | None | 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 | varchar | False | None | 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 | varchar | False | None | The operational taxonomic unit is a unique identifier for this instances of an observation whose identification isn't certain. |
| review_note | text | False | None | Optional note about the review. |
| reviewed_by_id | int4 | False | None | Relates to the [person](#rov.person) who reviewed the record. |
| reviewed_on | timestamp | False | None | Gives the time that the record was reviewed. |
| scientific_name | varchar | False | None | The scientific (binomial, trinomial) name of the taxon. Updated at audit time, based on the label or other fields. |


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


Links an [MSEA user](#shared.mseauser) to a [restriction](#shared.restriction). The user will have access to records related to this group.
<span id="ndst.transects"></span>
=== Table: transects ===


| Column Name | Type | Not Null | Default | Description |
Stores information about each transect.
| --- | --- | --- | --- | --- |
| created_on | timestamp | False | None | The creation time of the record. |
| restriction_id | int4 | False | None | The ID of the [restriction](#shared.restriction). |
| taxon_id | int4 | False | None | The ID of the [taxon](#shared.taxon). |
| updated_on | timestamp | False | None | The last update time of the record. |


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


Provides a lookup for the taxonomic grouping (Invertebrate, Fish, etc.) Used by VideoMiner.
<span id="rov"></span>
== Schema: rov ==


| Column Name | Type | Not Null | Default | Description |
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.
| --- | --- | --- | --- | --- |
| code | bpchar | False | None | A one-letter code for the grouping. |
| name | varchar | False | None | The name of the taxonomic grouping. |
| note | text | False | None | A note about the taxonomic grouping. |


##### Table: taxonomic_rank <a name="shared.taxonomic_rank"></a>  
<span id="rov.abundance"></span>
=== Table: abundance ===


Provides a lookup for the taxonomic rank (Kingdom, Class, Species, etc.) Used by VideoMiner.
Stores a list of abundance labels from the ACFOR scale.


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


##### Table: uploaded_file <a name="shared.uploaded_file"></a>  
<span id="rov.annotation_job"></span>
=== Table: annotation_job ===


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


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "annotation_job"
| created_on | timestamp | False | None | The time of creation of the record. |
|-
| expires_on | timestamp | False | None | The expiry time of the file. It may be deleted by a maintenance script after this time. |
! Name !! Type !! Nullable !! Documentation
| name | varchar | False | None | The original name of the file. |
|-
| path | varchar | False | None | The path to the temporary location of the file. |
| created_on || timestamp without time zone || YES || The date of creation of the entity.
| type | varchar | False | None | The guessed MIME type of the file. |
|-
| end_date || date || YES || The ending date of the project.
|-
| name || character varying || NO || A name for the annotation project.
|-
| note || text || YES || Operational notes about the annotation project.
|-
| objective || text || YES || A statement of the objectives of the annotation project.
|-
| start_date || date || YES || The starting date of the project.
|-
| updated_on || timestamp without time zone || YES || The date of last modification of the entity.
|}


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


These are tables which contain external taxonomic data and are used by tables in other schemas.
Associates the annotation job with one or more [[#rov.annotation_protocol|annotation protocols]], which are used to direct annotation activities.


#### Schema: inaturalist
{| class="wikitable"
|+ Columns in "annotation_job_annotation_protocol"
|-
! Name !! Type !! Nullable !! Documentation
|-
| annotation_job_id || integer || NO || The ID of the [[#rov.annotation_job|annotation job]].
|-
| annotation_protocol_id || integer || NO || The ID of the [[#rov.annotation_protocol|annotation protocol]].
|}


##### Table: observation <a name="inaturalist.observation"></a>  
<span id="rov.annotation_job_crew"></span>
=== Table: annotation_job_crew ===


Stores observations from the [iNaturalist species guide](https://www.inaturalist.org/projects/marine-life-of-the-northeast-pacific). TODO: This table isn't linked to the [taxon](#shared.taxon) table by a foreign key relation because the taxon ID is not unique in this table.
Associates crew members with an [[#rov.annotation_job|annotation job]] with their respective [[#rov.annotation_job_role|roles]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "annotation_job_crew"
| captive_cultivated | bool | False | None | True, if the observation is of a captive or farmed organism. |
|-
| common_name | varchar | False | None | The common name of the organism. |
! Name !! Type !! Nullable !! Documentation
| coordinates_obscured | bool | False | None | Indicates whether the coordinate is obscured for the public. |
|-
| created_at | timestamptz | False | None | The time of creation of the record. |
| annotation_job_id || integer || NO || The ID of the [[#rov.annotation_job|annotation job]].
| description | text | False | None | A description of the observation. |
|-
| geoprivacy | varchar | False | None | Set to private if the record is not public. TODO: Other values? |
| person_id || integer || NO || The ID of the [[#shared.person|crew member]].
| iconic_taxon_name | varchar | False | None | Grouping by arbitrary taxonomic level. |
|-
| image_url | text | False | None | A URL for an image of the observation. |
| role_id || integer || NO || The ID of the [[#rov.annotation_job_role|role]].
| latitude | float4 | False | None | The latitude of the observation. |
|}
| license | varchar | False | None | The license applied to the record. |
| longitude | float4 | False | None | The longitude of the observation. |
| num_identification_agreements | int2 | False | None | The number of votes for the identifaction. |
| num_identification_disagreements | int2 | False | None | Number of votes against the identification. |
| oauth_application_id | varchar | False | None | The ID of an OAUTH application used to modify the record. |
| observed_on | date | False | None | The time of observation. Created by combining the observed_on and time_observed_at and time_zone fields. |
| place_guess | varchar | False | None | The informal name of the site of the observation. |
| positional_accuracy | int4 | False | None | The positional accuracy of the observation position (m). |
| positioning_device | varchar | False | None | The device used to collect the position. |
| positioning_method | varchar | False | None | The positioning method. |
| public_positional_accuracy | int4 | False | None | The positional accuracy of the position showed to the public (m). |
| quality_grade | varchar | False | None | The quality of the report. 'research' indicates that the record is authoritative. |
| scientific_name | varchar | False | None | The scientific name given to the observation. |
| sound_url | text | False | None | A URL for a sound file for the record. |
| species_guess | varchar | False | None | A guess at the species name. |
| tag_list | jsonb | False | None | A list of tags associated with the observation. Represented as a JSON list. |
| taxon_class_name | varchar | False | None | The name of the taxon's class. |
| taxon_family_name | varchar | False | None | The family of the taxon. |
| taxon_form_name | varchar | False | None | The form of the taxon. |
| taxon_genus_name | varchar | False | None | The genus of the taxon. |
| taxon_genushybrid_name | varchar | False | None | The hybrid genus of the taxon. |
| taxon_geoprivacy | varchar | False | None | The privacy setting of the taxon. 'open' or 'obscured'. |
| taxon_hybrid_name | varchar | False | None | The hybrid name of the taxon. |
| taxon_id | int4 | False | None | The iNaturalist taxon ID. |
| taxon_kingdom_name | varchar | False | None | The taxon' kingdom. |
| taxon_order_name | varchar | False | None | The order of the taxon. |
| taxon_phylum_name | varchar | False | None | The taxon phylum. |
| taxon_species_name | varchar | False | None | The species of the taxon. |
| taxon_subclass_name | varchar | False | None | The taxon's subclass. |
| taxon_subfamily_name | varchar | False | None | The subfamily of the taxon. |
| taxon_suborder_name | varchar | False | None | The suborder of a taxon. |
| taxon_subphylum_name | varchar | False | None | The taxon subphylum. |
| taxon_subspecies_name | varchar | False | None | The subspecies of the taxon. |
| taxon_subtribe_name | varchar | False | None | The subtribe of the taxon. |
| taxon_superclass_name | varchar | False | None | The taxon superclass. |
| taxon_superfamily_name | varchar | False | None | The taxon's superfamily. |
| taxon_superorder_name | varchar | False | None | The superorder of the taxon. |
| taxon_supertribe_name | varchar | False | None | The supertribe of the taxon. |
| taxon_tribe_name | varchar | False | None | The tribe of the taxon. |
| taxon_variety_name | varchar | False | None | The variety name of the taxon. |
| updated_at | timestamptz | False | None | The time of update of the record. |
| url | text | False | None | A URL pointing to the online record. |
| user_id | int4 | False | None | The ID of the iNaturalist user. |
| user_login | varchar | False | None | The login name of the iNaturalist user. |


#### Schema: obis
<span id="rov.annotation_job_role"></span>
=== Table: annotation_job_role ===


##### Table: taxon <a name="obis.taxon"></a>
Stores the possible roles one can perform on an [[#rov.annotation_job|annotation job]].


OBIS taxonomy records imported directly from the OBIS observation data, but filtered for uniqueness on the Aphia ID.
{| class="wikitable"
|+ Columns in "annotation_job_role"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the role.
|-
| note || text || YES || A descript of the role.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.annotation_protocol"></span>
| --- | --- | --- | --- | --- |
=== Table: annotation_protocol ===
| aphiaid | int4 | False | None |  |
| class | varchar | False | None |  |
| domain | varchar | False | None |  |
| family | varchar | False | None |  |
| forma | varchar | False | None |  |
| genus | varchar | False | None |  |
| gigaclass | varchar | False | None |  |
| infraclass | varchar | False | None |  |
| infrakingdom | varchar | False | None |  |
| infraorder | varchar | False | None |  |
| infraphylum | varchar | False | None |  |
| kingdom | varchar | False | None |  |
| megaclass | varchar | False | None |  |
| natio | varchar | False | None |  |
| order | varchar | False | None |  |
| organismname | varchar | False | None |  |
| originalscientificname | varchar | False | None |  |
| parvorder | varchar | False | None |  |
| parvphylum | varchar | False | None |  |
| phylum | varchar | False | None |  |
| phylum_division | varchar | False | None |  |
| scientificname | varchar | False | None |  |
| section | varchar | False | None |  |
| series | varchar | False | None |  |
| species | varchar | False | None |  |
| subclass | varchar | False | None |  |
| subfamily | varchar | False | None |  |
| subforma | varchar | False | None |  |
| subgenus | varchar | False | None |  |
| subkingdom | varchar | False | None |  |
| suborder | varchar | False | None |  |
| subphylum | varchar | False | None |  |
| subphylum_subdivision | varchar | False | None |  |
| subsection | varchar | False | None |  |
| subspecies | varchar | False | None |  |
| subterclass | varchar | False | None |  |
| subtribe | varchar | False | None |  |
| subvariety | varchar | False | None |  |
| superclass | varchar | False | None |  |
| superdomain | varchar | False | None |  |
| superfamily | varchar | False | None |  |
| superorder | varchar | False | None |  |
| supertribe | varchar | False | None |  |
| taxonid | varchar | False | None |  |
| taxonomicstatus | varchar | False | None |  |
| taxonrank | varchar | False | None |  |
| taxonremarks | text | False | None |  |
| tribe | varchar | False | None |  |
| type | varchar | False | None |  |
| variety | varchar | False | None |  |
| vernacularname | varchar | False | None |  |


### Intertidal Database
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.


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


#### Schema: intertidal
<span id="rov.annotation_protocol_document"></span>
=== Table: annotation_protocol_document ===


##### Table: quadrat <a name="intertidal.quadrat"></a>
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.


A record of observations within an intertidal quadrat.
{| class="wikitable"
|+ Columns in "annotation_protocol_document"
|-
! Name !! Type !! Nullable !! Documentation
|-
| annotation_protocol_id || integer || NO || A reference to the [[#rov.annotation_protocol|annotation protocol]].
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
|-
| file_id || integer || YES || A reference to the [[#shared.uploaded_file|uploaded file]].
|-
| note || text || YES || An optional note about the document.
|-
| title || character varying || NO || The title of the document.
|-
| updated_on || timestamp without time zone || NO || The time of update of the record.
|-
| url || character varying || YES || An optional URL for the document. If file data are not given, this field is required.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.annotation_software"></span>
| --- | --- | --- | --- | --- |
=== Table: annotation_software ===
| centroid_height | float4 | False | None | The elevation of the corner position in m (ellipsoidal). |
| centroid_lat | float8 | False | None | The corner latitude. |
| centroid_lon | float8 | False | None | The corner longitude. |
| corner_height1 | float4 | False | None | The elevation of the corner position in m (ellipsoidal). |
| corner_height2 | float4 | False | None | The elevation of the corner position in m (ellipsoidal). |
| corner_height3 | float4 | False | None | The elevation of the corner position in m (ellipsoidal). |
| corner_height4 | float4 | False | None | The elevation of the corner position in m (ellipsoidal). |
| corner_lat1 | float8 | False | None | The corner latitude. |
| corner_lat2 | float8 | False | None | The corner latitude. |
| corner_lat3 | float8 | False | None | The corner latitude. |
| corner_lat4 | float8 | False | None | The corner latitude. |
| corner_lon1 | float8 | False | None | The corner longitude. |
| corner_lon2 | float8 | False | None | The corner longitude. |
| corner_lon3 | float8 | False | None | The corner longitude. |
| corner_lon4 | float8 | False | None | The corner longitude. |
| created_on | timestamp | False | None | created_on = models.DateTimeField(default = datetime.utcnow, null = False) |
| flag_number | varchar | False | None | The number of the flag used to mark the quadrat. May be non-numeric if necessary. |
| geom | geography | False | None | A geometry representing either the corners of the quadrat (multipoint) or the centroid. |
| name | varchar | False | None | A unique name for the quadrat. |
| note | text | False | None | An optional note about the quadrat. |
| survey_id | int4 | False | None | A reference to the [intertidal suvey](#intertidal.survey). |
| time | timestamp | False | None | The time of the quadrat (UTC). |
| transect | int4 | False | None | The transect number. This is an integer corresponding to whatever rubric was chosen for the survey. |
| zone | int4 | False | None | The zone number. This is an integer corresponding to whatever rubric was chosen for the survey. |


##### Table: quadrat_observation <a name="intertidal.quadrat_observation"></a>
The software used for annotation.


Records observations within [quadrats](#intertidal.quadrat). The observation type enumeration is defined in the database export panel.
{| class="wikitable"
|+ Columns in "annotation_software"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the annotation software.
|-
| note || text || YES || An optional note about the annotation software.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.biigle_label_map"></span>
| --- | --- | --- | --- | --- |
=== Table: biigle_label_map ===
| cell | int4 | False | None | The quadrat cell, typically from 0 - 100. |
| count | int4 | False | None | The number of organisms observed. |
| coverage | float4 | False | None | The percent coverage by the organism, 0-100. TODO: Not part of the specification. |
| length | float4 | False | None | The measured length of an organism. |
| quadrat_id | int4 | False | None | A link to the [quadrat](#intertidal.quadrat). |
| surveytaxon_id | int4 | False | None | A link to the [survey taxon](#intertidal.survey_taxon). |
| type | int4 | False | None | The type of observation; one of quadrat_obs_type. |


##### Table: quadrat_substrate <a name="intertidal.quadrat_substrate"></a>
Contains mappings from Biigle labels to properties that apply to events.


List substrates observed in intertidal quadrats.
{| class="wikitable"
|+ Columns in "biigle_label_map"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
|-
| label_hierarchy || text || NO || The full hierarchical text of the Biigle label.
|-
| label_id || integer || NO || The ID of the Biigle label.
|-
| label_text || text || NO || The text of the final element of the label.
|-
| label_tree_id || integer || NO || The ID of the Biigle label tree.
|-
| note || text || YES || A textual note or comment.
|-
| properties || jsonb || NO || Stores the properties of the observation.
|-
| updated_on || timestamp without time zone || NO || Time of last update of the record.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.biigle_label_map_restriction"></span>
| --- | --- | --- | --- | --- |
=== Table: biigle_label_map_restriction ===
| name | varchar | False | None | The name of the substrate. |


##### Table: quadrat_substrate_coverage <a name="intertidal.quadrat_substrate_coverage"></a>
Links a [[#rov.biigle_label_map|Biigle label map]] to a [restriction][#shared.restriction].


Associates [quadrat substrate](#intertidal.quadrat_substrate) coverages with [quadrats](#intertidal.quadrats).
{| class="wikitable"
|+ Columns in "biigle_label_map_restriction"
|-
! Name !! Type !! Nullable !! Documentation
|-
| biigle_label_map_id || integer || NO || A link to the [[#rov.biigle_label_map|label map]].
|-
| restriction_id || integer || NO || A link to the [[#shared.restriction|restriction]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.biocover"></span>
| --- | --- | --- | --- | --- |
=== Table: biocover ===
| coverage | float4 | False | None | The coverage amount between 0% and 100%. |
| quadrat_id | int4 | False | None | A reference to the [quadrat](#intertidal.quadrat). |
| substrate_id | int4 | False | None | A reference to the [substrate](#intertidal.quadrat_substrate). |


##### Table: survey <a name="intertidal.survey"></a>
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 metadata about intertidal surveys.
{| class="wikitable"
|+ Columns in "biocover"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the biocover.
|-
| note || text || YES || An optional description of the biocover.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a biocover (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.complexity"></span>
| --- | --- | --- | --- | --- |
=== Table: complexity ===
| created_on | timestamp | False | None | The time of creation of this record. |
| end_date | timestamp | False | None | The end date of the survey. |
| name | varchar | False | None | The name of the survey. |
| note | text | False | None | Notes about the survey. |
| objective | text | False | None | The survey objective. |
| site_id | int4 | False | None | Relates the survey to a [site](#shared.site) entity. |
| start_date | timestamp | False | None | The start date of the survey. |


##### Table: survey_crew <a name="intertidal.survey_crew"></a>
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 [intertidal survey](#intertidal.survey) crew members with [roles](#intertidal.survey_role).
{| class="wikitable"
|+ Columns in "complexity"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the complexity type.
|-
| note || text || YES || An optional description of the complexity type.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a complexity (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.coverage"></span>
| --- | --- | --- | --- | --- |
=== Table: coverage ===
| note | text | False | None | An optional note about the survey role. |
| person_id | int4 | False | None | A reference to the person with this [role](#shared.person). |
| role_id | int4 | False | None | A reference to the [role](#intertidal.survey_role). |
| survey_id | int4 | False | None | A reference to the [survey](#intertidal.survey). |


##### Table: survey_role <a name="intertidal.survey_role"></a>
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.


A list of roles available to [intertidal survey crew members](#intertidal.survey_crew).
{| class="wikitable"
|+ Columns in "coverage"
|-
! Name !! Type !! Nullable !! Documentation
|-
| maximum || real || NO || The minimum value in the range.
|-
| minimum || real || NO || The minimum value in the range.
|-
| name || character varying || NO || A characterization of percent coverage. Presented as a range of percentages.
|-
| note || text || YES || An optional note about the coverage percentage.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a coverage (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.cruise"></span>
| --- | --- | --- | --- | --- |
=== Table: cruise ===
| name | varchar | False | None | The name of the role. |
| note | text | False | None | A note about the role. |


##### Table: survey_taxon <a name="intertidal.survey_taxon"></a>
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.


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


| Column Name | Type | Not Null | Default | Description |
<span id="rov.cruise_crew"></span>
| --- | --- | --- | --- | --- |
=== Table: cruise_crew ===
| survey_id | int4 | False | None | A link to the [survey](#intertidal.survey). |
| taxon_id | int4 | False | None | A link to the [taxon](#shared.taxon) record. |


#### Schema: iform
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.


##### Table: event_log_data <a name="iform.event_log_data"></a>
{| class="wikitable"
|+ Columns in "cruise_crew"
|-
! Name !! Type !! Nullable !! Documentation
|-
| cruise_id || integer || NO || Reference to the [[#rov.cruise_leg|cruise leg]] to which the member is assigned.
|-
| cruise_role_id || integer || NO || Reference to the [[#rov.cruise_role|cruise role]].
|-
| note || text || YES || An optional note about the crew member.
|-
| person_id || integer || NO || Reference to the [[#rov.person|person]] on the crew.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.cruise_document"></span>
| --- | --- | --- | --- | --- |
=== Table: cruise_document ===
| content | jsonb | False | None |  |
| created_on | timestamp | False | None |  |


##### View: event_log <a name="iform.event_log"></a>
Stores information about documents related to a [[#rov.cruise|cruise]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "cruise_document"
| created_date | text | False | None | |
|-
| created_device_id | text | False | None | |
! Name !! Type !! Nullable !! Documentation
| event_description | text | False | None | |
|-
| event_time | text | False | None | |
| created_on || timestamp without time zone || NO || The date and time of creation of the entity.
| event_title | text | False | None | |
|-
| event_type | text | False | None | |
| cruise_id || integer || NO || The ID of the [[#rov.cruise|cruise]].
| modified_date | text | False | None |  |
|-
| modified_device_id | text | False | None |  |
| file_id || integer || YES || [None]
| notes | text | False | None |  |
|-
| photos | text | False | None | |
| note || text || YES || A note about the document.
| position | text | False | None |  |
|-
| position_json | text | False | None | |
| title || character varying || NO || The title of the document.
| recorder | text | False | None |  |
|-
| trip_id | text | False | None |  |
| updated_on || timestamp without time zone || NO || The date and time of the entity's last update.
|-
| url || character varying || YES || A URL for the online copy of the document. May be used when no file is available.
|}


### Annotation Database
<span id="rov.cruise_fn_contact"></span>
=== Table: cruise_fn_contact ===


These are tables related to the annotation database.
A table for associating First Nations contacts with a cruise.


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


##### Table: abundance <a name="rov.abundance"></a>  
<span id="rov.cruise_import"></span>
=== Table: cruise_import ===


Stores a list of abundance labels from the ACFOR scale.
Stores cruise import tasks in the database. These contain the JSON data description, a status message and complete processing log.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "cruise_import"
| name | varchar | False | None | A descriptive label for the abundance level. |
|-
| note | text | False | None | An optional note about the abundance level. |
! Name !! Type !! Nullable !! Documentation
| rank | int4 | False | None | 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 | varchar | False | None | Contains a short code that can be used to look up an abundance (e.g., during import) without relying on the primary key. |
| created_on || timestamp without time zone || YES || [None]
| source | varchar | False | None | A source label to distinguish abundance labels with the same names. TODO: Provisional, pending determination of how abundance codes are handled. |
|-
| data || jsonb || NO || A JSON document containing the cruise import data.
|-
| logs || jsonb || NO || A JSON array containing the complete processing log.
|-
| name || character varying || NO || A unique name for the import job.
|-
| status || character varying || NO || A status message about processing.
|-
| updated_on || timestamp without time zone || YES || [None]
|-
| version || integer || NO || [None]
|}


##### Table: annotation_config <a name="rov.annotation_config"></a>  
<span id="rov.cruise_library"></span>
=== Table: cruise_library ===


Links the [annotation protocol](#rov.annotation_protocol) to an [instrument configuration](#rov.instrument_config) to document how annotations were generated.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "cruise_library"
| annotation_protocol_id | int4 | False | None | Links to the [annotation protocol](#rov.annotation_protocol). |
|-
| instrument_config_id | int4 | False | None | Links to the [instrument configuration](#rov.instrument_config). |
! Name !! Type !! Nullable !! Documentation
| note | text | False | None | An optional note about the configuration. |
|-
| cruiseleg_id || integer || NO || A reference to the [[#rov.cruise_leg|cruise leg]].
|-
| library_id || integer || NO || A reference to the document in the [[#rov.library|library]].
|-
| note || text || YES || An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc.
|}


##### Table: annotation_config_logger <a name="rov.annotation_config_logger"></a>  
<span id="rov.cruise_program"></span>
=== Table: cruise_program ===


Associates one or more [loggers](#shared.person) with an [annotation configuration](#rov.annotation_config).
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "cruise_program"
| annotation_config_id | int4 | False | None | The [annotation configuration](#rov.annotation_config) that this logger belongs to. |
|-
| logger_id | int4 | False | None | The [person](#shared.person) responsible for generating the annotations. |
! Name !! Type !! Nullable !! Documentation
|-
| cruise_id || integer || NO || The ID of a [[#rov.cruise|cruise]].
|-
| program_id || integer || NO || The ID of a [[#rov.program|program]].
|}


##### Table: annotation_observation_type <a name="rov.annotation_observation_type"></a>  
<span id="rov.cruise_role"></span>
=== Table: cruise_role ===


Provides a multiple linkage to target [species](#shared.taxon) and [observation](#rov.observation_type) types with respect to the [annotation protocol](#rov.annotation_protocol).
A lookup table of roles available to members of [[#rov.cruise_leg_crew|cruise leg crews]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "cruise_role"
| annotation_protocol_id | int4 | False | None | The [annotation protocol](#rov.annotation_protocol) record to which this item applies. |
|-
| observation_category_id | int4 | False | None | A reference to the category: whether the entry involves the target species, a non-target species or an areal species (etc., possibly) |
! Name !! Type !! Nullable !! Documentation
| observation_type_id | int4 | False | None | A reference to the [observation type](#rov.observation_type). |
|-
| taxon_id | int4 | False | None | A link to the [species](#shared.taxon). |
| name || character varying || NO || The name of the role.
|-
| note || text || YES || An optional note about the role and its responsibilities.
|-
| short_code || character varying || YES || A short string used to identify the role.
|}


##### Table: annotation_protocol <a name="rov.annotation_protocol"></a>  
<span id="rov.disturbance"></span>
=== Table: disturbance ===


A table to record annotation protocols for annotation [projects](#rov.project). TODO: Currently under development as a concept. The idea is to develop the protocol and mark it as a template. Users will create [projects](#rov.project) and either associate them with a template protocol or copy and edit the protocol and use the copy. Any protocol can be marked as a template for future use. The template concept is largely a convenience.
Provides a nominal level of disturbance for [[#rov.habitat_event|habitat events]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"  
| --- | --- | --- | --- | --- |
|+ Columns in "disturbance"
| algae_species | varchar | False | None | Whether all algae species are identified: "all", "subset" or "none". |
|-
| annotation_software_id | int4 | False | None | Software used to annotate the video or images. Looked up in the [annotation software](#rov.annotation_software) table. |
! Name !! Type !! Nullable !! Documentation
| biogenic_habitat | bool | False | None | True if any habitat categories include fauna (e.g., sponge reefs). |
|-
| created_on | timestamp | False | None | The date of creation of this record. |
| name || character varying || NO || The textual representation of the disturbance level.
| creator_id | int4 | False | None | Records the identity of the person who created this protocol. |
|-
| fish_species | varchar | False | None | Whether all fish species are identified: "all", "subset" or "none". |
| note || text || YES || A note about the disturbance level.
| fov_interval | float4 | False | None |  |
|-
| fov_interval_unit | varchar | False | None | A unit for the field of view interval, such as 's' for seconds or 'm' for metres. |
| short_code || character varying || YES || Contains a short code that can be used to look up a disturbance (e.g., during import) without relying on the primary key.
| habitat_interval | float4 | False | None |  |
|}
| habitat_interval_unit | varchar | False | None | A unit for the habitat interval, such as 's' for seconds or 'm' for metres. |
| habitat_only | bool | False | None | Set to true if only habitat variables were recorded. |
| image_interval | float4 | False | None | The interval between images or frame grabs. Typically 3 to 10 seconds. |
| image_interval_unit | varchar | False | None | A unit for the image interval, such as 's' for seconds or 'm' for metres. |
| image_overlap | bool | False | None | Is there overlap between the images (true) or do they represent independent non-overlapping space (false). |
| invertebrate_species | varchar | False | None | Whether all invertebrate species are identified: "all", "subset" or "none". |
| is_template | bool | False | None | If this is meant to be a template that is copied for use, mark this column `true`. |
| medium_type_id | int4 | False | None | The type of media used for annotation. Looked up in [media type](#rov.medium_type) table.  |
| name | varchar | False | None | The name of the annotation protocol. Should be unique. |
| note | text | False | None | If only a subset of invert, fish or algae species were identified, note here which groups were the primary focus (target species). For example, benthic fish or corals and sponges. Also for other notes of interest. |
| observation_interval | float4 | False | None |  |
| observation_interval_unit | varchar | False | None | A unit for the observation interval, such as 's' for seconds or 'm' for metres. |
| project_id | int4 | False | None | A reference to the [project](#rov.project) to which this record is attached. |
| protocol_document | varchar | False | None | Link, title, DOI, etc. of a document describing the protocol in full. |
| species_guide | varchar | False | None | A URL to the iNaturalist species guide that was used for annotation. |
| updated_on | timestamp | False | None | The date of update of this record. |


##### Table: annotation_protocol_document <a name="rov.annotation_protocol_document"></a>  
<span id="rov.dive"></span>
=== Table: dive ===


Contains documents related to an [annotation protocol](rov.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.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "dive"
| annotation_protocol_id | int4 | False | None | A reference to the [annotation protocol](#rov.annotation_protocol). |
|-
| created_on | timestamp | False | None | The time of creation of the record. |
! Name !! Type !! Nullable !! Documentation
| file_name | varchar | False | None | The original name of the document file. |
|-
| file_path | varchar | False | None | The path to the file on the file system. If not given, a URL is required. |
| admin_note || text || YES || [None]
| file_type | varchar | False | None | The [mime type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the file. Required if file data are given. |
|-
| note | text | False | None | An optional note about the document. |
| attributes || jsonb || YES || A JSON column used for recording structured attributes that do not fit with the regular table structure.
| title | varchar | False | None | The title of the document. |
|-
| updated_on | timestamp | False | None | The time of update of the record. |
| created_on || timestamp without time zone || NO || The date of creation of this record.
| url | varchar | False | None | An optional URL for the document. If file data are not given, this field is required. |
|-
| cruise_id || integer || NO || A reference to the [[#rov.cruise_leg|cruise leg]] during which the dive was performed.
|-
| end_time || timestamp without time zone || NO || The end of the dive.
|-
| mark_for_delete || boolean || NO || Marks the entity for asynchronous deletion by the runner.
|-
| name || character varying || NO || A name for the dive.
|-
| note || text || YES || An optional note about the dive.
|-
| objective || text || YES || A statement of the practical or research objectives for this dive.
|-
| seatube_id || integer || YES || The ID of a dive on SeaTube corresponding to this dive.
|-
| ship_config_id || integer || NO || A reference to the [[#rov.platform_config|platform config]] for the ship.
|-
| site || character varying || YES || An optional name for the site.
|-
| start_time || timestamp without time zone || NO || The start of the dive. Not necessarily the time the vehicle is placed in the water.
|-
| sub_config_id || integer || NO || A reference to the [[#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.
|}


##### Table: annotation_protocol_taxon <a name="rov.annotation_protocol_taxon"></a>  
<span id="rov.dive_crew"></span>
=== Table: dive_crew ===


Links an [annotation protocol](#rov.annotation_protocol) record to a [taxon](#shared.taxon) record. This is done because an organism observed during an annotation project may be labeled differently than the same organism observed during a different project. If thise occurs, those records will have to be reconciled during a later audit.
Assigns roles to dive crew members. Crew members are selected from the [[#rov.person|person]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "dive_crew"
| annotation_protocol_id | int4 | False | None | A link to the [annotation protocol](#rov.annotation_protocol). |
|-
| taxon_id | int4 | False | None | A link to the [taxon](#shared.taxon). |
! Name !! Type !! Nullable !! Documentation
|-
| dive_id || integer || NO || The [[#rov.dive|dive]] to which the crew member is assigned.
|-
| dive_role_id || integer || NO || A reference to the [[#rov.dive_role|dive role]].
|-
| note || text || YES || An optional note about the crew member.
|-
| person_id || integer || NO || A reference to the [[#rov.person|person]].
|}


##### Table: annotation_software <a name="rov.annotation_software"></a>  
<span id="rov.dive_role"></span>
=== Table: dive_role ===


The software used for annotation.
A list of roles available to crew members on a [[#rov.dive|dive]] via the [[#rov.dive_crew|dive_crew]] table.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "dive_role"
| name | varchar | False | None | The name of the annotation software. |
|-
| note | text | False | None | An optional note about the annotation software. |
! Name !! Type !! Nullable !! Documentation
| short_code | bpchar | False | None | Provides a short code for looking up the entity. |
|-
| name || character varying || NO || The name of the role.
|-
| note || text || YES || An optional description of the role.
|-
| short_code || character varying || YES || A short string used to identify the role.
|}


##### Table: available_setting <a name="rov.available_setting"></a>  
<span id="rov.equipment_type"></span>
=== Table: equipment_type ===


This table supplies a list of available settings for configuring instances of this model in the [instrument_config](#rov.instrument_config) and [platform_config](#rov.platform_config) tables. The items in this table have a name, a datatype and an optional regular expression that can be used to validate the setting at the application level, as well as an optional list of options.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "equipment_type"
| choices | text | False | None | A comma-delimited list of options from which the user can choose at the application level. |
|-
| model_id | int4 | False | None | The [model](#rov.model) to which the setting applies. |
! Name !! Type !! Nullable !! Documentation
| name | varchar | False | None | The name of the setting. |
|-
| note | text | False | None | A note about the setting. |
| category || USER-DEFINED || YES || An enumeration column identifying the equipment as platform, instrument or some other type.
| type | varchar | False | None | The datatype of the setting (e.g., "float", "string"). This is used as a hint to the user but in future may be formalized for type-checking by the application. |
|-
| validator | varchar | False | None | An optional regular expression to check the user-entered value. This would ordinarily apply only to values with a "string" type. Numeric inputs would be checked implicitly during type conversion, but a regular expression can nevertheless be used to validate numeric inputs in the UI. |
| name || character varying || NO || A name for the equipment type.
|-
| note || text || YES || An optional note about the equipment type.
|}


##### Table: biocover <a name="rov.biocover"></a>  
<span id="rov.event"></span>
=== Table: event ===


A lookup table listing the available biocover types for the [habitat_event](#rov.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](#shared.taxon) table.
The event table, a schemaless table storing all recorded observations and statuses during operations.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "event"
| name | varchar | False | None | The name of the biocover. |
|-
| note | text | False | None | An optional description of the biocover. |
! Name !! Type !! Nullable !! Documentation
| short_code | varchar | False | None | Contains a short code that can be used to look up a biocover (e.g., during import) without relying on the primary key. |
|-
| annotation_job_id || integer || YES || [None]
|-
| created_on || timestamp without time zone || NO || The time of creation of the event.
|-
| dive_id || integer || NO || A reference to the dive during which this event occurred.
|-
| end_time || timestamp without time zone || YES || The end time of the event. Null, if the event is discrete.
|-
| hidden || boolean || NO || If true, the entity should be hidden from searches and reports. An alternative to deleting entities that may prove useful in the future.
|-
| instrument_config_id || integer || YES || [None]
|-
| note || text || YES || An optional note about the event. Do not use to store event data.
|-
| properties || jsonb || NO || A JSON object containing name-value pairs describing the event.
|-
| restriction_mask || bit || NO || [None]
|-
| start_time || timestamp without time zone || NO || The start time of the event.
|-
| updated_on || timestamp without time zone || NO || The time of update of the event. Automatically updated by a trigger.
|}


##### Table: comment_event <a name="rov.comment_event"></a>  
<span id="rov.event_logger"></span>
=== Table: event_logger ===


Provides a way to record comments rather than using a sparse note field on the [event](#rov.table).
This table tracks the [[#shared.person|people]] who contributed to annotation, which may be composed of a number of separate labels.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "event_logger"
| event_id | int4 | False | None | A reference to the [parent event](#rov.event). |
|-
| note | text | False | None | A text comment or note. |
! Name !! Type !! Nullable !! Documentation
|-
| event_id || integer || NO || The [[#rov.event|event]] that was created from the annotation(s).
|-
| person_id || integer || NO || A [[#shared.person|person]] who contributed to the annotation.
|}


##### Table: complexity <a name="rov.complexity"></a>  
<span id="rov.flow"></span>
=== Table: flow ===


A lookup table listing the available habitat complexity types for the [habitat_event](#rov.habitat_event) table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
Stores categories of current flow for [[#rov.habitat_event|habitat]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "flow"
| name | varchar | False | None | The name of the complexity type. |
|-
| note | text | False | None | An optional description of the complexity type. |
! Name !! Type !! Nullable !! Documentation
| short_code | varchar | False | None | Contains a short code that can be used to look up a complexity (e.g., during import) without relying on the primary key. |
|-
| name || character varying || NO || A note about the flow category.
|-
| note || text || YES || [None]
|-
| short_code || character varying || YES || A short code for the flow category.
|}


##### Table: coverage <a name="rov.coverage"></a>  
<span id="rov.generic_label_map"></span>
=== Table: generic_label_map ===


A lookup table listing the percentage of coverage for the [habitat_event](#rov.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.
A table for storing mappings from annotation labels to property sets.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "generic_label_map"
| maximum | float4 | False | None | The minimum value in the range. |
|-
| minimum | float4 | False | None | The minimum value in the range. |
! Name !! Type !! Nullable !! Documentation
| name | varchar | False | None | A characterization of percent coverage. Presented as a range of percentages. |
|-
| note | text | False | None | An optional note about the coverage percentage. |
| created_on || timestamp without time zone || NO || The date of creation.
| short_code | varchar | False | None | Contains a short code that can be used to look up a coverage (e.g., during import) without relying on the primary key. |
|-
| label_text || USER-DEFINED || NO || The text of the label.
|-
| note || text || YES || A note about the mapping.
|-
| properties || jsonb || NO || A dictionary of mapped properties.
|-
| updated_on || timestamp without time zone || NO || The date of last update.
|}


##### Table: cruise <a name="rov.cruise"></a>  
<span id="rov.generic_label_map_restriction"></span>
=== Table: generic_label_map_restriction ===


Cruise legs occur within a [cruise](#rov.cruise) and are assigned specific [crews](#rov.cruise_leg_crew), [scientific programs](#rov.program), 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](#rov.program) or a [cruise](#rov.cruise) because imported data sets may only list the name of the cruise and not indicate whether it was part of a longer cruise.
Links a [[#rov.generic_label_map|generic label mapping]] to a [[#shared.restriction|restriction]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "generic_label_map_restriction"
| approved | int4 | False | None | If zero, the record is not approved and should not be shown or used. Currently a non-zero value represents approval, but may be expanded to various levels of approval in the future. |
|-
| created_on | timestamp | False | None | The date of creation of this record. |
! Name !! Type !! Nullable !! Documentation
| end_time | timestamp | False | None | The end time of the leg. |
|-
| leg | int4 | False | None | Cruise legs are numbered from 1. |
| generic_label_map_id || integer || NO || A reference to a [[#rov.generic_label_map|generic label mapping]].
| name | varchar | False | None | A name for this leg of the cruise. |
|-
| note | text | False | None | Notes about the cruise. |
| restriction_id || integer || NO || A reference to a [[#shared.restriction|restriction]].
| objective | text | False | None | A statement of the operational or scientific objectives of the cruise. |
|}
| planned_track | geography | False | None | A multilinestring containing the planned track of the leg. TODO: Not known whether this is necessary. |
| ship_id | int4 | False | None |  |
| start_time | timestamp | False | None | The start time of the leg. |
| summary | text | False | None | A summary of the cruise, with information about whether the objectives were met and any other pertinent information. |
| updated_on | timestamp | False | None | The date of update of this record. |


##### Table: cruise_crew <a name="rov.cruise_crew"></a>  
<span id="rov.image_quality"></span>
 
=== Table: image_quality ===
Associates [crew members](#rov.person) with a [cruise leg](#rov.cruise_leg) and their [roles](#rov.cruise_role). A crew member can have multiple roles. Note: these roles are distinct from members of [programs](#rov.program), such as Chief Scientist. It may be necessary to revisit this structure or the division of roles.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| cruise_id | int4 | False | None |  Reference to the [cruise leg](#rov.cruise_leg) to which the member is assigned. |
| cruise_role_id | int4 | False | None | Reference to the [cruise role](#rov.cruise_role). |
| note | text | False | None | An optional note about the crew member. |
| person_id | int4 | False | None | Reference to the [person](#rov.person) on the crew. |
 
##### Table: cruise_document <a name="rov.cruise_document"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| created_on | timestamp | False | None |  |
| cruise_id | int4 | False | None |  |
| file_name | varchar | False | None |  |
| file_path | varchar | False | None |  |
| file_type | varchar | False | None |  |
| note | text | False | None |  |
| title | varchar | False | None |  |
| updated_on | timestamp | False | None |  |
| url | varchar | False | None |  |
 
##### Table: cruise_fn_contact <a name="rov.cruise_fn_contact"></a>
 
A table for associating First Nations contacts with a cruise.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| contact_name | varchar | False | None | The full name of the contact. |
| cruise_id | int4 | False | None | A reference to the [cruise](#rov.cruise). |
| email | varchar | False | None | The email address of the contact. |
| nation | text | False | None | The name of the nation or group represented by the contact. |
| note | text | False | None | A note about the contact. |
| phone | varchar | False | None | The phone number of the contact. |
 
##### Table: cruise_library <a name="rov.cruise_library"></a>
 
This table creates an association between a [cruise leg](#rov.cruise_leg) and [documents in the library](#rov.library) that may be relevant to its research objectives.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| cruiseleg_id | int4 | False | None | A reference to the [cruise leg](#rov.cruise_leg). |
| library_id | int4 | False | None | A reference to the document in the [library](#rov.library). |
| note | text | False | None | An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc. |
 
##### Table: cruise_program <a name="rov.cruise_program"></a>
 
A table to link [programs](#rov.program) and [cruises](#rov.cruise). A cruise can be under the auspices of more than one program or none.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| cruise_id | int4 | False | None | The ID of a [cruise](#rov.cruise). |
| program_id | int4 | False | None | The ID of a [program](#rov.program). |
 
##### Table: cruise_role <a name="rov.cruise_role"></a>
 
A lookup table of roles available to members of [cruise leg crews](#rov.cruise_leg_crew).
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the role. |
| note | text | False | None | An optional note about the role and its responsibilities. |
| short_code | varchar | False | None |  |
 
##### Table: disturbance <a name="rov.disturbance"></a>
 
Provides a nominal level of disturbance for [habitat events](#rov.habitat_event).
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The textual representation of the disturbance level. |
| note | text | False | None | A note about the disturbance level. |
| short_code | varchar | False | None | Contains a short code that can be used to look up a disturbance (e.g., during import) without relying on the primary key. |
 
##### Table: dive <a name="rov.dive"></a>
 
A dive is what an ROV does. The dive has a start and end time (not necessarily submerge/resurface), a [crew](#rov.dive_crew) and possibly a name. [Transects](#rov.transect) occur during dives.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| attributes | jsonb | False | None | A JSON column used for recording structured attributes that do not fit with the regular table structure. |
| created_on | timestamp | False | None | The date of creation of this record. |
| cruise_id | int4 | False | None | A reference to the [cruise leg](#rov.cruise_leg) during which the dive was performed. |
| end_time | timestamp | False | None | The end of the dive. |
| name | varchar | False | None | A name for the dive. |
| note | text | False | None | An optional note about the dive. |
| objective | text | False | None | A statement of the practical or research objectives for this dive. |
| ship_config_id | int4 | False | None | A reference to the [platform config](#rov.platform_config) for the ship. |
| site_id | int4 | False | None | Optional reference to the geographic [site](#rov.site) of the dive. |
| start_time | timestamp | False | None | The start of the dive. Not necessarily the time the vehicle is placed in the water. |
| sub_config_id | int4 | False | None | A reference to the [platform config](#rov.platform_config) for the submersible or ROV. |
| summary | text | False | None | A summary of the [dive](#rov.dive); whether objectives were met, problems encountered, etc. |
| updated_on | timestamp | False | None | The date of update of this record. |
 
##### Table: dive_crew <a name="rov.dive_crew"></a>
 
Assigns roles to dive crew members. Crew members are selected from the [person](#rov.person).
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| dive_id | int4 | False | None | The [dive](#rov.dive) to which the crew member is assigned. |
| dive_role_id | int4 | False | None | A reference to the [dive role](#rov.dive_role). |
| note | text | False | None | An optional note about the crew member. |
| person_id | int4 | False | None | A reference to the [person](#rov.person). |
 
##### Table: dive_role <a name="rov.dive_role"></a>
 
A list of roles available to crew members on a [dive](#rov.dive) via the [dive_crew](#rov.dive_crew) table.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the role. |
| note | text | False | None | An optional description of the role. |
| short_code | varchar | False | None |  |
 
##### Table: equipment_type <a name="rov.equipment_type"></a>
 
This is a lookup table to provide the names of types of equipment for the [model_equipment_type](#rov.model_equipment_type) table, e.g., "Digital Still Camera", "Thermometer," "ROV," etc.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| category | equipment_category | False | None | An enumeration column identifying the equipment as platform, instrument or some other type. |
| name | varchar | False | None | A name for the equipment type. |
| note | text | False | None | An optional note about the equipment type. |
| short_code | varchar | False | None | A short code for referencing the equipment type in import documents. |
 
##### Table: event <a name="rov.event"></a>
 
The event table is a parent or abstract table that provides properties common to [habitat](#rov.habitat_event), [observation](#rov.observation_event), [status](#rov.status_event) and [measurement](#rov.measurement_event) 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.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| annotation_config_id | int4 | False | None | The [annotation configuration](#rov.annotation_config) used to generate this event. |
| attributes | jsonb | False | None |  |
| created_on | timestamp | False | None | The time of creation of this record. |
| dive_id | int4 | False | None | A reference to a [dive](#rov.dive). |
| end_time | timestamp | False | None | The end time of the event. If the event is instantaneous, this field is null. |
| frames | jsonb | False | None | Preserves the frames from the Biigle annotation. |
| medium_filename | varchar | False | None | The name of the media file from which this event is derived. |
| medium_id | int4 | False | None | A reference to the [medium](#rov.medium) on which this annotation was created. |
| original_id | int4 | False | None | The original ID of the event if read from a source that has IDs. |
| original_labels | jsonb | False | None | Optionally stores information about annotation labels used to generate this event. For Biigle, stores the label IDs. |
| shape | jsonb | False | None | The shape used for annotations (e.g., Biigle). The coordinates for this shape should have been converted to metres. GeoJSON doesn't support circles, so we use a format that encapsulates the shape type and the raw list of coordinates, something like: { "type": "circle", "shape": [1.0, 1.0, 1.0] } which is a circle with radius 1 at position 1,1. A whole-screen annotation will be a rectangle the size of the screen. |
| shape_area | float8 | False | None | The area of the shape in square metres, calculated from the screenand shape dimensions and the laser point distance. |
| start_time | timestamp | False | None | The time at the start of the event. If the event is instantaneous, this is the time at which it occurred. |
| tags | jsonb | False | None | Stores a list of tags relevant to this event. |
| transect_id | int4 | False | None | An optional reference to a [transect](#rov.transect). TODO: Clarify the use of transects and whether this column is nullable. |
 
##### Table: event_logger <a name="rov.event_logger"></a>
 
This table tracks the [people](#shared.person) who contributed to annotation, which may be composed of a number of separate labels.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| event_id | int4 | False | None | The [event](#rov.event) that was created from the annotation(s). |
| person_id | int4 | False | None | A [person](#shared.person) who contributed to the annotation. |
 
##### Table: habitat_event <a name="rov.habitat_event"></a>
 
The habitat event table records information about the [biocover](#rov.biocover), [thickness](#rov.thickness), [substrate](#rov.substrate) and [complexity](#rov.complexity) of the habitat. Some survey protocols record the taxon with biocover observations. A reference to the [taxon](#shared.taxon) table is provided. This table is a realization of the [event](#rov.event) table.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| annotation_protocol_taxon_id | int4 | False | None | A reference to the taxon for a species named as biocover or substrate. |
| biocover_coverage_id | int4 | False | None | A [coverage](#rov.coverage) value for the [biocover](#rov.biocover). |
| biocover_id | int4 | False | None | A reference to the [biocover](#rov.biocover) lookup. |
| complexity_id | int4 | False | None | A reference to the [habitat complexity](#rov.complexity) lookup. |
| disturbance_id | int4 | False | None | Indicates the level of disturbance of the substrate and/or biota. |
| event_id | int4 | False | None | A reference to the parent [event](#rov.event). |
| relief_id | int4 | False | None | A reference to the [relief](#rov.relief) level. |
| substrate_coverage_id | int4 | False | None | A [coverage](#rov.coverage) value for the [substrate](#rov.substrate). |
| substrate_id | int4 | False | None | A reference to the dominant [substrate](#rov.substrate) lookup. |
| thickness_id | int4 | False | None | A reference to the [biocover thickness](#rov.thickness) lookup. |
 
##### Table: image_quality <a name="rov.image_quality"></a>


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


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "image_quality"
| name | varchar | False | None | A name for the quality level. |
|-
| note | text | False | None | An optional note. |
! Name !! Type !! Nullable !! Documentation
| rank | int4 | False | None | An ordinal rank (zero is high) for the quality level. |
|-
| short_code | varchar | False | None | Contains a short code that can be used to look up an image quality (e.g., during import) without relying on the primary key. |
| name || character varying || NO || A name for the quality level.
|-
| note || text || YES || An optional note.
|-
| rank || integer || YES || An ordinal rank (zero is high) for the quality level.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up an image quality (e.g., during import) without relying on the primary key.
|}


##### Table: import_queue_annotator <a name="rov.import_queue_annotator"></a>  
<span id="rov.import_queue_annotator"></span>
=== Table: import_queue_annotator ===


Stores the import packages created by annotators.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "import_queue_annotator"
| created_on | timestamp | False | None | The date of creation of the record. |
|-
| cruise_name | varchar | False | None | The name of the [cruise](#rov.cruise) to which this record is linked. A lookup is not used because the cruise record may not have been created yet. |
! Name !! Type !! Nullable !! Documentation
| data | jsonb | False | None | Stores the JSON representation of the import job. |
|-
| mseauser_id | int4 | False | None | A reference to the [MSEA user](#shared.mseauser) that created the record. |
| created_on || timestamp without time zone || NO || The date of creation of the record.
| name | varchar | False | None | A unique name for the import queue record. |
|-
| note | text | False | None | An optional note about the import package. |
| 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.
| status | varchar | False | None | A short description of the processing status of the job. |
|-
| updated_on | timestamp | False | None | The date of update of the record. |
| data || jsonb || NO || Stores the JSON representation of the import job.
|-
| end_date || date || YES || [None]
|-
| hidden || boolean || NO || [None]
|-
| name || character varying || NO || A unique name for the import queue record.
|-
| note || text || YES || An optional note about the import package.
|-
| objective || text || YES || [None]
|-
| start_date || date || YES || [None]
|-
| status || character varying || YES || A short description of the processing status of the job.
|-
| updated_on || timestamp without time zone || NO || The date of update of the record.
|-
| user_id || integer || NO || A reference to the [[#shared.mseauser|MSEA user]] that created the record.
|}


##### Table: import_queue_annotator_label_map_prefill <a name="rov.import_queue_annotator_label_map_prefill"></a>  
<span id="rov.import_queue_annotator_label_map_prefill"></span>
=== Table: import_queue_annotator_label_map_prefill ===


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


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "import_queue_annotator_label_map_prefill"
| created_on | timestamp | False | None | |
|-
| label_tree_name | varchar | False | None | The label tree name. If given identifies the label uniquely with the tree name. |
! Name !! Type !! Nullable !! Documentation
| name | varchar | False | None | The text of the label. |
|-
| tag_data | jsonb | False | None | The the tag data. |
| created_on || timestamp without time zone || YES || The date and time of creation of the entity.
| tags | jsonb | False | None | The list of tags. |
|-
| updated_on | timestamp | False | None | |
| event_type || jsonb || YES || [None]
|-
| label_tree_name || character varying || YES || The label tree name. If given identifies the label uniquely with the tree name.
|-
| name || character varying || NO || The text of the label.
|-
| properties || jsonb || NO || The the tag data.
|-
| tags || jsonb || NO || The list of tags.
|-
| updated_on || timestamp without time zone || YES || The date and time of the entity's last update.
|}


##### Table: import_queue_pi <a name="rov.import_queue_pi"></a>  
<span id="rov.import_queue_pi"></span>
=== Table: import_queue_pi ===


Stores the import packages created by principal investigators.
Stores the import packages created by principal investigators.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "import_queue_pi"
| created_on | timestamp | False | None | The date of creation of the record. |
|-
| cruise_id | int4 | False | None | A reference to the [cruise](#rov.cruise). |
! Name !! Type !! Nullable !! Documentation
| mseauser_id | int4 | False | None | A reference to the [MSEA user](#shared.mseauser) that created the record. |
|-
| name | varchar | False | None | A name of the import job |
| created_on || timestamp without time zone || NO || The date of creation of the record.
| note | text | False | None | An optional note about the import package. |
|-
| status | varchar | False | None | A short description of the processing status of the job. |
| cruise_id || integer || NO || A reference to the [[#rov.cruise|cruise]].
| updated_on | timestamp | False | None | The date of update of the record. |
|-
| hidden || boolean || NO || [None]
|-
| name || character varying || NO || A name of the import job
|-
| note || text || YES || An optional note about the import package.
|-
| status || character varying || YES || A short description of the processing status of the job.
|-
| updated_on || timestamp without time zone || NO || The date of update of the record.
|-
| user_id || integer || NO || A reference to the [[#shared.mseauser|MSEA user]] that created the record.
|}


##### Table: instrument <a name="rov.instrument"></a>  
<span id="rov.instrument"></span>
=== Table: instrument ===


This table represents instruments, which are concrete instances of the types represented in the [model](#rov.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](#rov.platform).
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]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "instrument"
| attributes | jsonb | False | None | A freeform list of attributes for this instrument. |
|-
| created_on | timestamp | False | None | The date of creation of this record. |
! Name !! Type !! Nullable !! Documentation
| model_id | int4 | False | None | A reference to the instrument [model](#rov.model). |
|-
| note | text | False | None | An optional note about this instrument. |
| attributes || jsonb || YES || A freeform list of attributes for this instrument.
| organisation_id | int4 | False | None | A reference to the organisation that owns and operates the instrument. |
|-
| retired | date | False | None | If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active. |
| created_on || timestamp without time zone || NO || The date of creation of this record.
| serial_number | varchar | False | None | 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 | varchar | False | None | Contains a short code that can be used to look up an instrument (e.g., during import) without relying on the primary key. |
| model_id || integer || NO || A reference to the instrument [[#rov.model|model]].
| updated_on | timestamp | False | None | The date of update of this record. |
|-
| name || character varying || YES || A name for the instrument to distinguish it from others of the same model.
|-
| note || text || YES || An optional note about this instrument.
|-
| organisation_id || integer || NO || A reference to the organisation that owns and operates the instrument.
|-
| retired || date || YES || If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active.
|-
| serial_number || character varying || NO || The serial number of the instrument. If a serial number is not available, some unique identifier can be substituted. No two instruments of the same model may have the same serial number.
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}


##### Table: instrument_config <a name="rov.instrument_config"></a>  
<span id="rov.instrument_config"></span>
=== Table: instrument_config ===


This table records the configuration of an instrument, including settings and its spatial relationship to a parent entity -- another configured vehicle or instrument upon which this instrument is mounted.
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 Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "instrument_config"
| configuration | jsonb | False | None | Configuration information about the instrument config. |
|-
| created_on | timestamp | False | None | The date of creation of this record. |
! Name !! Type !! Nullable !! Documentation
| name | varchar | False | None | The name of the instrument config. Need not be unique: used to identify the config within the platform config. |
|-
| note | text | False | None | An optional note about this configuration. |
| configuration || jsonb || YES || Configuration information about the instrument config.
| platform_config_id | int4 | False | None | |
|-
| updated_on | timestamp | False | None | The date of update of this record. |
| created_on || timestamp without time zone || NO || The date of creation of this record.
 
|-
##### Table: instrument_config_instrument <a name="rov.instrument_config_instrument"></a>
| instrument_id || integer || NO || Reference to the [[#rov.instrument|instrument]] targeted by the configuration.
 
|-
This table links an [instrument](#rov.instrument) to an [instrument config](#rov.instrument_config) to enable the use of multiple instrument in the creation of a stream of measurements.
| mark_for_delete || boolean || NO || Marks the entity for asynchronous deletion by the runner.
 
|-
| Column Name | Type | Not Null | Default | Description |
| note || text || YES || An optional note about this configuration.
| --- | --- | --- | --- | --- |
|-
| configuration | text | False | None | A JSON object describing the configuration attributes of this instrument. |
| platform_config_id || integer || YES || The ID of the [[#rov.platform|platform]] upon which the instrument is used.
| instrument_config_id | int4 | False | None | A link to the [instrument config](#rov.instrument_config). |
|-
| instrument_id | int4 | False | None | A link to the [instrument](#rov.instrument). |
| updated_on || timestamp without time zone || NO || The date of update of this record.
 
|}
##### Table: instrument_setting <a name="rov.instrument_setting"></a>
 
This table contains the settings on a [configured instrument](#rov.instrument_config). These are settings that are changeable between dives and are usually important to the interpretation of the data. Generally, if the configuration is changed, a copy of the [instrument configuration](#rov.instrument_config) is made, and the settings in the new configuration are altered. Available instrument settings can be looked up in the [available_setting](#rov.available_setting) table, along with data type and validation hints. The ID of the available setting is not stored, because the setting relationships are not meant to be enforced.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| instrument_config_id | int4 | False | None | A reference to the [instrument configuration](#rov.instrument_config) to which this setting applies. |
| name | varchar | False | None | The name of the setting. May be looked up in the [available settings](#rov.available_setting) table. |
| note | text | False | None | An optional note about the configuration. |
| value | varchar | False | None | The value of the setting. May be validated by the regular expression and type conversion specified in the [available settings](#rov.available_setting) table if the setting name matches. |


##### Table: measurement <a name="rov.measurement"></a>  
<span id="rov.measurement"></span>
=== Table: measurement ===


This table preserves time-stamped measurements generated by [instruments](#rov.instrument_config). 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 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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "measurement"
| instrument_config_id | int4 | False | None | The [configured instrument](#rov.instrument_config) used to generate this item. |
|-
| is_modelled | bool | False | None | A flag to indicate whether the value is derived from measurements by some modelling process. |
! Name !! Type !! Nullable !! Documentation
| measurement_type_id | int4 | False | None | A reference to the [type](#rov.measurement_type) of this measurement. |
|-
| quantity | float4 | False | None | The scalar quantity or magnitude of the measurement. |
| instrument_config_id || integer || NO || The [[#rov.instrument_config|configured instrument]] used to generate this item.
| signal_quality | float4 | False | None | A quality of the measurement as reported by the instrument. TODO: Requires clarification. |
|-
| timestamp | timestamp | False | None | The time that the measurement was recorded. |
| is_modelled || boolean || NO || A flag to indicate whether the value is derived from measurements by some modelling process.
|-
| measurement_type_id || integer || NO || A reference to the [[#rov.measurement_type|type]] of this measurement.
|-
| quantity || real || NO || The scalar quantity or magnitude of the measurement.
|-
| signal_quality || real || YES || A quality of the measurement as reported by the instrument. TODO: Requires clarification.
|-
| timestamp || timestamp without time zone || NO || The time that the measurement was recorded.
|}


##### Table: measurement_event <a name="rov.measurement_event"></a>  
<span id="rov.measurement_type"></span>
=== Table: measurement_type ===


A table for storing human-created measurements.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "measurement_type"
| event_id | int4 | False | None | A reference to the parent [event](#rov.event). |
|-
| measurement_type_id | int4 | False | None | A reference to the [measurement type](#rov.measurement_type). |
! Name !! Type !! Nullable !! Documentation
| quantity | float4 | False | None | The measurement value in the [measurement type](#rov.measurement_type) unit. |
|-
| maximum || real || YES || An optional upper bound on the value of the measurement. Null implies no limit.
|-
| minimum || real || YES || An optional lower bound on the value of the measurement. Null implies no limit.
|-
| name || character varying || NO || The type of measurement. E.g., "Density" or "Salinity."
|-
| note || text || YES || An optional note about this measurement type.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a measurement type (e.g., during import) without relying on the primary key.
|-
| unit || character varying || NO || The unit. SI units are preferred but not required. The unit selection should probably depend on field-specific idiomatic or cultural preferences.
|}


##### Table: measurement_type <a name="rov.measurement_type"></a>  
<span id="rov.medium_format"></span>
=== Table: medium_format ===


This is a lookup table of types of measurement types for the [measurement](#rov.measurement) or [measurement_event](#rov.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 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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "medium_format"
| maximum | float4 | False | None | An optional upper bound on the value of the measurement. Null implies no limit. |
|-
| minimum | float4 | False | None | An optional lower bound on the value of the measurement. Null implies no limit. |
! Name !! Type !! Nullable !! Documentation
| name | varchar | False | None | The type of measurement. E.g., "Density" or "Salinity." |
|-
| note | text | False | None | An optional note about this measurement type. |
| 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.
| short_code | varchar | False | None | Contains a short code that can be used to look up a measurement type (e.g., during import) without relying on the primary key. |
|-
| unit | varchar | False | None | The unit. SI units are preferred but not required. The unit selection should probably depend on field-specific idiomatic or cultural preferences. |
| medium_type_id || integer || NO || A reference to the [[#rov.medium_type|medium type]] (e.g., video or photo).
|-
| name || character varying || NO || The name of the format.
|-
| note || text || YES || An optional note about the format.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a medium format (e.g., during import) without relying on the primary key.
|}


##### Table: medium <a name="rov.medium"></a>  
<span id="rov.medium_type"></span>
=== Table: medium_type ===


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


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "medium_type"
| biigle_video_id | int4 | False | None | Provisional: the ID of the video as represented in [Biigle.de](https://biigle.de). |
|-
| created_on | timestamp | False | None | The date of creation of this record. |
! Name !! Type !! Nullable !! Documentation
| file_id | int4 | False | None | A required reference to the [file](#shared.file). |
|-
| geostamp_source_id | int4 | False | None | The source of the geostamp information on photo or video data. Refers to an [instrument](#rov.instrument), e.g., a GPS. |
| name || character varying || NO || The name of the media type.
| height | int4 | False | None | The height of the video frame in pixels. |
|-
| instrument_config_id | int4 | False | None | An [instrument configuration](#rov.instrument_config) for the instrument that generated this media. |
| note || text || YES || An optional note about the media type.
| length | float4 | False | None | If a video or acoustic file (etc.), the length in seconds. |
|-
| medium_format_id | int4 | False | None | A reference to the [format](#rov.medium_format) of the data. |
| short_code || character || YES || Provides a short code for looking up the entity.
| note | text | False | None | An optional note about this data. |
|}
| parent_id | int4 | False | None | If the video or photo is derived or cropped from another, this refers to the source record (optional). |
| source_time | float4 | False | None | If this is an extract from a video or a frame grab, indicates the zero-based start time with respect to the source video. |
| start_time | timestamp | False | None | The start date/time of this video, or the instantaneous time if it's a photograph. |
| thumbnail | bytea | False | None | An optional thumbnail to represent the stored medium. |
| width | int4 | False | None | The width of the video frame in pixels. |


##### Table: medium_format <a name="rov.medium_format"></a>  
<span id="rov.model"></span>
=== Table: model ===


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


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


##### Table: medium_type <a name="rov.medium_type"></a>  
<span id="rov.model_documentation"></span>
=== Table: model_documentation ===


A simple lookup to provide media types to the [annotation_protocol](#rov.annotation_protocol) table. These are not specific media formats (as stored in [medium_format](#rov.medium_format)), but provided a higher-level distinction.
This table creates an association between a [[#rov.model|model]] and [[#rov.library|documentation in the library]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "model_documentation"
| name | varchar | False | None | The name of the media type. |
|-
| note | text | False | None | An optional note about the media type. |
! Name !! Type !! Nullable !! Documentation
| short_code | bpchar | False | None | Provides a short code for looking up the entity. |
|-
| library_id || integer || NO || A reference to the document in the [[#rov.library|library]].
|-
| model_id || integer || NO || A reference to the [[#rov.model|model]].
|-
| note || text || YES || An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc.
|}


##### Table: model <a name="rov.model"></a>  
<span id="rov.model_equipment_type"></span>
=== Table: model_equipment_type ===


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](#rov.instrument) table. The model table stores both [instruments](#rov.instrument) and [platforms](#rov.platform).
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "model_equipment_type"
| attributes | jsonb | False | None | A free-form JSON field for attributes of this model. |
|-
| brand_name | varchar | False | None | The brand name. |
! Name !! Type !! Nullable !! Documentation
| equipment_type_id | int4 | False | None | A reference to the [equipment type](#rov.equipment_type). |
|-
| model_name | varchar | False | None | The model name. |
| equipment_type_id || integer || NO || The [[#rov.equipment_type|equipment type]] ID.
| note | text | False | None | An optional note about the model. |
|-
| model_id || integer || NO || A reference to the [[#rov.model|model]].
|}


##### Table: model_documentation <a name="rov.model_documentation"></a>  
<span id="rov.observation_confidence"></span>
=== Table: observation_confidence ===


This table creates an association between a [model](#rov.model) and [documentation in the library](#rov.library).
Provides a nominal observation confidence level for [[#rov.observation_event|observation events]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "observation_confidence"
| library_id | int4 | False | None | A reference to the document in the [library](#rov.library). |
|-
| model_id | int4 | False | None | A reference to the [model](#rov.model). |
! Name !! Type !! Nullable !! Documentation
| note | text | False | None | An optional note about the document with respect to the cruise leg. May be used to reference points of interest in a paper, etc. |
|-
| name || character varying || NO || The textual representation of the confidence level.
|-
| note || text || YES || A note about the confidence level.
|-
| rank || integer || NO || This field is a way of ranking confidence levels so that an ordering can be established.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a observation confidence (e.g., during import) without relying on the primary key.
|}


##### Table: model_equipment_type <a name="rov.model_equipment_type"></a>  
<span id="rov.orientation"></span>
=== Table: orientation ===


This table associates an equipment [model](#rov.model) with the abstract type of equipment it represents. For example, a GoPro Hero4 is both a digital video camera and a digital still camera. These values are taken from the [equipment_type](#rov.equipment_type) table.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "orientation"
| equipment_type_id | int4 | False | None | The [equipment type](#rov.equipment_type) ID. |
|-
| model_id | int4 | False | None | A reference to the [model](#rov.model). |
! 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.
|-
| orientation || jsonb || NO || The orientation vector.
|-
| orientation_type_id || integer || NO || A reference to the [[#rov.orientation_type|orientation type]] of this orientation.
|-
| signal_quality || real || YES || The signal quality of the position as reported by the instrument. TODO: Requires clarification.
|-
| timestamp || timestamp without time zone || NO || The time the position was recorded.
|}


##### Table: observation_category <a name="rov.observation_category"></a>  
<span id="rov.orientation_type"></span>
=== Table: orientation_type ===


Observation categories are used by [annotation protocols](#rov.annotation_protocol).
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "orientation_type"
| name | varchar | False | None | The name of the observation category. |
|-
| note | text | False | None | An optional note about the observation category. |
! Name !! Type !! Nullable !! Documentation
| short_code | varchar | False | None | A short code for referencing the observation category in import documents. |
|-
| name || character varying || NO || The name of the orientation type (e.g., "Quaternion").
|-
| note || text || YES || An optional note about the orientation type.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up an orientation type (e.g., during import) without relying on the primary key.
|-
| unit || character varying || NO || The units used to interpret the elements of the vector.
|}


##### Table: observation_confidence <a name="rov.observation_confidence"></a>  
<span id="rov.platform"></span>
 
=== Table: platform ===
Provides a nominal observation confidence level for [observation events](#rov.observation_event).
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The textual representation of the confidence level. |
| note | text | False | None | A note about the confidence level. |
| rank | int4 | False | None | This field is a way of ranking confidence levels so that an ordering can be established. |
| short_code | varchar | False | None | Contains a short code that can be used to look up a observation confidence (e.g., during import) without relying on the primary key. |
 
##### Table: observation_event <a name="rov.observation_event"></a>
 
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 [label tree](#rov.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 [annotation protocol](#rov.annotation_protocol) table. This table is a realization of the [event](#rov.event) table.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| abundance_id | int4 | False | None | Link to an [abundance level](#rov.abundance). |
| annotation_protocol_taxon_id | int4 | False | None | An indirect link to the [taxon](#shared.taxon) identified in this record. |
| category | varchar | False | None | A free-form category label used for distinguishing types of labels within an annotation project. Useful for flagging records for review. |
| count | int4 | False | None | The number of individuals observed. TODO: Interpretation depends on the observation interval as recorded in the[annotation protocol](#rov.annotation_protocol) table. |
| coverage_id | int4 | False | None | Provides an indication of the amount of a scene [covered](#rov.coverage) by an organism. Implies habitat forming. |
| event_id | int4 | False | None | A reference to the parent [event](#rov.event). |
| observation_confidence_id | int4 | False | None | References the [observation confidence](#rov.observation_confidence) lookup to indicate the user's confidence in the observation. |
 
##### Table: observation_type <a name="rov.observation_type"></a>
 
A list of observation types -- that is, ways of counting individuals, ranging in specificity from mere presence or absence to relative abundance to specific counts.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the observation type. |
| note | text | False | None | An optional note describing the observation type. |
| short_code | varchar | False | None | A short code for referencing the observation type in import documents. |
 
##### Table: orientation <a name="rov.orientation"></a>
 
This table preserves time-stamped orientation measurements from [instruments](#rov.instrument_config). These are interpreted according to a [specified type](#rov.orientation_type). Ship and ROV orientation will be recorded here, though ships don't ordinarily have an orientation.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| instrument_config_id | int4 | False | None | The [configured instrument](#rov.instrument_config) used to generate this item. |
| is_modelled | bool | False | None | A flag to indicate whether the value is derived from measurements by some modelling process. |
| orientation | jsonb | False | None | The orientation vector. |
| orientation_type_id | int4 | False | None | A reference to the [orientation type](#rov.orientation_type) of this orientation. |
| signal_quality | float4 | False | None | The signal quality of the position as reported by the instrument. TODO: Requires clarification. |
| timestamp | timestamp | False | None | The time the position was recorded. |
 
##### Table: orientation_type <a name="rov.orientation_type"></a>
 
These entities describe the interpretation of the orientation vector in the [instrument_config](#rov.instrument_config) and [orientation](#rov.orientation) tables. This can be a 3- or 4-element vector representing yaw, pitch roll; Tait-Bryan angles; Euler angles or a Quaternion.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the orientation type (e.g., "Quaternion"). |
| note | text | False | None | An optional note about the orientation type. |
| short_code | varchar | False | None | Contains a short code that can be used to look up an orientation type (e.g., during import) without relying on the primary key. |
| unit | varchar | False | None | The units used to interpret the elements of the vector. |
 
##### Table: platform <a name="rov.platform"></a>


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


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "platform"
| attributes | jsonb | False | None | A freeform list of attributes for this platform. |
|-
| created_on | timestamp | False | None | The date of creation of this record. |
! Name !! Type !! Nullable !! Documentation
| model_id | int4 | False | None | A reference to the [model](#rov.model) of the platform. |
|-
| name | varchar | False | None | 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. |
| attributes || jsonb || YES || A freeform list of attributes for this platform.
| note | text | False | None | An optional note about this platform. |
|-
| organisation_id | int4 | False | None | A reference to the organisation that owns and operates the platform. |
| created_on || timestamp without time zone || NO || The date of creation of this record.
| retired | date | False | None | If the platform is retired, this records the date. If null, the platform is assumed to be active. |
|-
| serial_number | varchar | False | None | 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. |
| model_id || integer || NO || A reference to the [[#rov.model|model]] of the platform.
| short_code | varchar | False | None | Contains a short code that can be used to look up a platform (e.g., during import) without relying on the primary key. |
|-
| updated_on | timestamp | False | None | The date of update of this record. |
| name || character varying || NO || The name of the platform. If this is a ship, it might be "CCGS Vector" or if it's an ROV, it might be given an arbitrary name by the maintainer.
|-
| note || text || YES || An optional note about this platform.
|-
| organisation_id || integer || NO || A reference to the organisation that owns and operates the platform.
|-
| retired || date || YES || If the platform is retired, this records the date. If null, the platform is assumed to be active.
|-
| serial_number || character varying || YES || The serial number of the platform. If this is an ROV it will be the manufacturer's serial number. If it's a vessel, this might be the IMO number. In any case, it must be unique.
|-
| short_code || character || YES || Contains a short code that can be used to look up a platform (e.g., during import) without relying on the primary key.
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}


##### Table: platform_config <a name="rov.platform_config"></a>  
<span id="rov.platform_config"></span>
=== Table: platform_config ===


This table stores configuration information about vehicles (ships, ROVs,etc.) used for surveys. All references to vehicles are made through this table rather than directly to the [platform](#rov.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 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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "platform_config"
| configuration | jsonb | False | None | The configuration data as a JSON object. |
|-
| created_on | timestamp | False | None | The date of creation of this record. |
! Name !! Type !! Nullable !! Documentation
| note | text | False | None | An optional note about the configuration record. |
|-
| platform_id | int4 | False | None | A reference to the [platform](#rov.platform). |
| configuration || jsonb || YES || The configuration data as a JSON object.
| updated_on | timestamp | False | None | The date of update of this record. |
|-
| created_on || timestamp without time zone || NO || The date of creation of this record.
|-
| mark_for_delete || boolean || NO || Marks the entity for asynchronous deletion by the runner.
|-
| note || text || YES || An optional note about the configuration record.
|-
| platform_id || integer || NO || A reference to the [[#rov.platform|platform]].
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}


##### Table: platform_setting <a name="rov.platform_setting"></a>  
<span id="rov.position"></span>
=== Table: position ===


This table contains the settings on a [configured platform](#rov.platform_config). These are settings that are changeable between dives and are usually important to the interpretation of the data. Available platform settings can be looked up in the [available_setting](#rov.available_setting) table, along with data type and validation hints. The ID of the available setting is not stored, because the setting relationships are not meant to be enforced. If a setting is changed between dives, it is advisable to copy the setting record and all associated [platform settings](#rov.platform_setting) before changing the configuration.
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?


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "position"
| name | varchar | False | None | The name of the setting. May be looked up in the [available settings](#rov.available_setting) table. |
|-
| note | text | False | None | An optional note about the setting. |
! Name !! Type !! Nullable !! Documentation
| platform_config_id | int4 | False | None | A reference to the [platform configuration](#rov.platform_config). |
|-
| value | varchar | False | None | The value of the setting. If a name from the [available settings](#rov.available_setting) list is used, the regular expression or type conversion may be applied to validate the value. |
| geom || geometry || YES || The point geometry.
|-
| 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.
|-
| position_type_id || integer || NO || A reference to the [[#rov.position_type|position type]] of this position.
|-
| signal_quality || real || YES || The signal quality of the position as reported by the instrument. TODO: Requires clarification.
|-
| timestamp || timestamp without time zone || NO || The time the position was recorded.
|}


##### Table: position <a name="rov.position"></a>  
<span id="rov.position_type"></span>
=== Table: position_type ===


This table preserves time-stamped position measurements from [instruments](#rov.instrument_config). These can be linear (e.g., UTM) or angular (e.g., Geographic) positions in a [specified unit](#rov.position_type). 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?
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "position_type"
| geom | geography | False | None | The point geometry. |
|-
| instrument_config_id | int4 | False | None | The [configured instrument](#rov.instrument_config) used to generate this item. |
! Name !! Type !! Nullable !! Documentation
| is_modelled | bool | False | None | A flag to indicate whether the value is derived from measurements by some modelling process. |
|-
| position_type_id | int4 | False | None | A reference to the [position type](#rov.position_type) of this position. |
| name || character varying || NO || The name of the position type. E.g., "Geographic" or "Yaw, Pitch, Roll."
| signal_quality | float4 | False | None | The signal quality of the position as reported by the instrument. TODO: Requires clarification. |
|-
| timestamp | timestamp | False | None | The time the position was recorded. |
| note || text || YES || An optional note about this position type.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a position type (e.g., during import) without relying on the primary key.
|-
| unit || character varying || NO || The unit. Linear or angular. E.g., "m" or "radians."
|}


##### Table: position_type <a name="rov.position_type"></a>  
<span id="rov.program"></span>
=== Table: program ===


Describes the interpretation of a coordinate vector in the [position](#rov.position) table. These can be geographic or Cartesian positions or orientations and have defined linear or angular units.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "program"
| name | varchar | False | None | The name of the position type. E.g., "Geographic" or "Yaw, Pitch, Roll." |
|-
| note | text | False | None | An optional note about this position type. |
! Name !! Type !! Nullable !! Documentation
| short_code | varchar | False | None | Contains a short code that can be used to look up a position type (e.g., during import) without relying on the primary key. |
|-
| unit | varchar | False | None | The unit. Linear or angular. E.g., "m" or "radians." |
| created_on || timestamp without time zone || NO || The date of creation of this item.
|-
| end_date || date || YES || The optional end date of the program.
|-
| name || character varying || NO || The name of the program.
|-
| note || text || YES || An optional note about the program.
|-
| objective || character varying || YES || The objective or mandate of the program.
|-
| start_date || date || NO || The starting date of the program.
|-
| summary || text || YES || A summary of the [[#rov.program|program]]; whether objectives were met, problems encountered, etc.
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}


##### Table: program <a name="rov.program"></a>  
<span id="rov.program_library"></span>
=== Table: program_library ===


This is a listing of scientific programs that can be associated with [cruise legs](#rov.cruise_leg), and gives information about the governorship and funding of specific research activities. [Label trees](#rov.label_tree) and [taxonomies](#shared.taxonomy) 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.
A table to associate [[#rov.program|programs]] with [[#shared.library|library]] documents.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "program_library"
| created_on | timestamp | False | None | The date of creation of this item. |
|-
| end_date | date | False | None | The optional end date of the program. |
! Name !! Type !! Nullable !! Documentation
| name | varchar | False | None | The name of the program. |
|-
| note | text | False | None | An optional note about the program. |
| library_id || integer || NO || A reference to the [[#shared.library|library]] item.
| objective | varchar | False | None | The objective or mandate of the program. |
|-
| start_date | date | False | None | The starting date of the program. |
| program_id || integer || NO || A reference to the [[#rov.program|program]] item.
| summary | text | False | None | A summary of the [program](#rov.program); whether objectives were met, problems encountered, etc. |
|}
| updated_on | timestamp | False | None | The date of update of this record. |


##### Table: program_library <a name="rov.program_library"></a>  
<span id="rov.program_member"></span>
=== Table: program_member ===


A table to associate [programs](#rov.program) with [library](#shared.library) documents.
Assigns [[#rov.person|user]] [[#rov.program_role|roles]] to a [[#rov.program|program]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "program_member"
| library_id | int4 | False | None | A reference to the [library](#shared.library) item. |
|-
| program_id | int4 | False | None | A reference to the [program](#rov.program) item. |
! Name !! Type !! Nullable !! Documentation
|-
| person_id || integer || NO || A reference to the [[#rov.person|person]].
|-
| program_id || integer || NO || The reference to the [[#rov.program|program]].
|-
| role_id || integer || NO || A reference to the [[#rov.program_role|program role]].
|}


##### Table: program_member <a name="rov.program_member"></a>  
<span id="rov.program_role"></span>
=== Table: program_role ===


Assigns [user](#rov.person) [roles](#rov.program_role) to a [program](#rov.program).
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "program_role"
| person_id | int4 | False | None | A reference to the [person](#rov.person). |
|-
| program_id | int4 | False | None | The reference to the [program](#rov.program). |
! Name !! Type !! Nullable !! Documentation
| role_id | int4 | False | None | A reference to the [program role](#rov.program_role). |
|-
| name || character varying || NO || The name of the role. E.g., "Chief Scientist."
|-
| note || text || YES || An optional note about the role.
|}


##### Table: program_role <a name="rov.program_role"></a>  
<span id="rov.protocol"></span>
=== Table: protocol ===


Represents the roles a [person](#rov.person) might perform in respect to a [program](#rov.program). A person can be assigned multiple roles within a single program, and multiple people can work on a program with the same role.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "protocol"
| name | varchar | False | None | The name of the role. E.g., "Chief Scientist." |
|-
| note | text | False | None | An optional note about the role. |
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || A name for the survey protocol.
|-
| note || text || YES || An optional note about the protocol.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a survey protocol (e.g., during import) without relying on the primary key.
|}


##### Table: project <a name="rov.project"></a>  
<span id="rov.relief"></span>
=== Table: relief ===


projects are created by users to coordinate annotation or other activities where [observation](#rov.observation_event) and [habitat](#rov.habitat_event) events are created. The project helps to group events in terms of why they were created, when and by whom.
Provides a nominal level of terrain relief for [[#rov.habitat_event|habitat events]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "relief"
| created_on | timestamp | False | None | The date of creation of this record. |
|-
| end_date | date | False | None | The end date of the project (optional). |
! Name !! Type !! Nullable !! Documentation
| name | varchar | False | None | The name of the project. |
|-
| note | text | False | None | A descriptive note about the project. |
| name || character varying || NO || The textual representation of the relief level.
| objective | text | False | None | A note describing the objective of this project. |
|-
| start_date | date | False | None | The creation date of the project. |
| note || text || YES || A note about the relief level.
| summary | text | False | None | A summary of the [project](#rov.project); whether objectives were met, problems encountered, etc. |
|-
| updated_on | timestamp | False | None | The date of update of this record. |
| short_code || character varying || YES || Contains a short code that can be used to look up a relief (e.g., during import) without relying on the primary key.
|}


##### Table: project_cruise <a name="rov.project_cruise"></a>  
<span id="rov.signup_area"></span>
=== Table: signup_area ===


Links a [project](#rov.project) to the [cruises](#rov.cruise) that were imported.
Stores the region within which sign-ups are permitted, generally North America.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "signup_area"
| cruise_id | int4 | False | None | The [cruise](#rov.cruise). |
|-
| project_id | int4 | False | None | The [project](#rov.project). |
! Name !! Type !! Nullable !! Documentation
|-
| geom || geometry || YES || The geometry of the sign-up region.
|-
| name || character varying || NO || The name of the sign-up region.
|}


##### Table: project_import_source <a name="rov.project_import_source"></a>  
<span id="rov.status_type"></span>
=== Table: status_type ===


Stores information about files from which data for events, measurements and positions have been loaded.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "status_type"
| file_id | int4 | False | None | The source [file](#shared.file). |
|-
| note | text | False | None | An optional note about the source file. |
! Name !! Type !! Nullable !! Documentation
| project_id | int4 | False | None | A reference to the project that this file is associated with. |
|-
| name || character varying || NO || The name of the status event.
|-
| note || text || YES || An optional description of the status type.
|-
| short_code || character || YES || A short code for referencing the status type in import documents.
|}


##### Table: project_member <a name="rov.project_member"></a>  
<span id="rov.status_type_detail"></span>
=== Table: status_type_detail ===


This table associates [personnel](#rov.person) with [projects](#rov.project) under specific [roles](#rov.project_role). A project can have multiple members, each of whom can generate observations.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "status_type_detail"
| person_id | int4 | False | None | The [person](#rov.person) assigned to the project. |
|-
| project_id | int4 | False | None | The [project](#rov.project) to which this member is assigned. |
! Name !! Type !! Nullable !! Documentation
| role_id | int4 | False | None | The [role](#rov.project_role) assigned to this user (optional). |
|-
| name || character varying || NO || The status type detail. This field distinguishes different uses for [[#rov.status_type|status types]]. For example, there can be more than one reason to record an "Off Transect" event.
|-
| note || text || YES || Optional extended description of detail.
|-
| short_code || character || YES || Contains a short code that can be used to look up a status type detail (e.g., during import) without relying on the primary key.
|-
| status_type_id || integer || NO || A reference to the [[#rov.status_type|status type]].
|}


##### Table: project_role <a name="rov.project_role"></a>  
<span id="rov.substrate"></span>
=== Table: substrate ===


This table lists available roles for [users](#rov.project_member) involved in [projects](#rov.project).
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "substrate"
| name | varchar | False | None | The name of the role. |
|-
| note | text | False | None | An optional note about the role. |
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the substrate.
|-
| note || text || YES || An optional description of the substrate.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a substrate (e.g., during import) without relying on the primary key.
|}


##### Table: protocol <a name="rov.protocol"></a>  
<span id="rov.survey_mode"></span>
=== Table: survey_mode ===


This table stores "(survey) protocol" entries from the source data. TODO: Used by [events](#rov.event) though it's not yet clear if it should stay this way.
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "survey_mode"
| name | varchar | False | None | A name for the survey protocol. |
|-
| note | text | False | None | An optional note about the protocol. |
! Name !! Type !! Nullable !! Documentation
| short_code | varchar | False | None | Contains a short code that can be used to look up a survey protocol (e.g., during import) without relying on the primary key. |
|-
| name || character varying || NO || The name of the survey mode.
|-
| note || text || YES || An optional note about the survey mode.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a survey mode (e.g., during import) without relying on the primary key.
|}


##### Table: relief <a name="rov.relief"></a>  
<span id="rov.thickness"></span>
=== Table: thickness ===


Provides a nominal level of terrain relief for [habitat events](#rov.habitat_event).
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.


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "thickness"
| name | varchar | False | None | The textual representation of the relief level. |
|-
| note | text | False | None | A note about the relief level. |
! Name !! Type !! Nullable !! Documentation
| short_code | varchar | False | None | Contains a short code that can be used to look up a relief (e.g., during import) without relying on the primary key. |
|-
| maximum || real || YES || The maximum value in the range.
|-
| minimum || real || YES || The minimum value in the range.
|-
| name || character varying || NO || A characterization of biocover thickness.
|-
| note || text || YES || An optional note about the biocover thickness.
|-
| short_code || character varying || YES || Contains a short code that can be used to look up a thickness (e.g., during import) without relying on the primary key.
|}


##### Table: status_event <a name="rov.status_event"></a>  
<span id="rov.transect"></span>
=== Table: transect ===


This table records status events with names given by the [status_type_detail](#rov.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 [event](#rov.event).
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]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "transect"
| event_id | int4 | False | None | The associated [event](#rov.event). |
|-
| status_type_detail_id | int4 | False | None | The [detailed status type](#rov.status_type_detail). |
! Name !! Type !! Nullable !! Documentation
|-
| admin_note || text || YES || [None]
|-
| attributes || jsonb || YES || A JSON column used for recording structured attributes that do not fit with the regular table structure.
|-
| dive_id || integer || NO || A reference to the [[#rov.dive|dive]] during which this transect occurred.
|-
| end_time || timestamp without time zone || YES || The end time of the transect.
|-
| name || character varying || NO || The name of the transect.
|-
| note || text || YES || An optional note about the transect.
|-
| objective || text || YES || A statement of the practical or research objectives for this true.
|-
| start_time || timestamp without time zone || NO || The start time of the transect.
|-
| summary || text || YES || A summary of the [[#rov.transect|transect]]; whether objectives were met, problems encountered, etc.
|}


##### Table: status_type <a name="rov.status_type"></a>  
<span id="rov.weather_observation"></span>
=== Table: weather_observation ===


This is a lookup table for available status types, such as "on bottom" or "off bottom." These are specialized in the [status_type_detail](#rov.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.
Surface weather observations can be recorded by any [[#rov.cruise_leg_crew|crew member]] aboard a ship during a [[#rov.cruise_leg|cruise leg]].


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "weather_observation"
| name | varchar | False | None | The name of the status event. |
|-
| note | text | False | None | An optional description of the status type. |
! Name !! Type !! Nullable !! Documentation
| short_code | varchar | False | None | A short code for referencing the status type in import documents. |
|-
| cruise_crew_id || integer || YES || A reference to the [[#rov.cruise_leg_crew|cruise leg crew]] member who is making the report.
|-
| cruise_id || integer || NO || A link to the [[#rov.cruise|cruise]] during which this record was recorded.
|-
| note || text || YES || An optional note about the observation
|-
| pressure || real || YES || The air pressure.
|-
| swell || character varying || YES || Description of swell.
|-
| temperature || real || YES || The air temperature.
|-
| time || timestamp without time zone || NO || An optional note about the weather.
|-
| wind_direction || real || YES || The wind direction.
|-
| wind_speed || real || YES || The wind speed.
|}


##### Table: status_type_detail <a name="rov.status_type_detail"></a>  
<span id="shared"></span>
== Schema: shared ==


This table associates a [status type](#rov.status_type) with a [status event](#rov.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](#rov.status_type) value is the discriminator for the event, but the detail adds context the doesn't interfere with it.
Stores data that are shared between other schemas, such as personnel information, taxonomy, etc.


| Column Name | Type | Not Null | Default | Description |
<span id="shared.db_version"></span>
| --- | --- | --- | --- | --- |
=== Table: db_version ===
| detail | varchar | False | None | The status type detail. This field distinguishes different uses for [status types](#rov.status_type). For example, there can be more than one reason to record an "Off Transect" event. |
| note | text | False | None | Optional extended description of detail. |
| short_code | varchar | False | None | Contains a short code that can be used to look up a status type detail (e.g., during import) without relying on the primary key. |
| status_type_id | int4 | False | None | A reference to the [status type](#rov.status_type). |


##### Table: substrate <a name="rov.substrate"></a>
Stores the current database version so that upgrade scripts can perform migrations appropriately.


A lookup table listing the available substrate types for the [habitat_event](#rov.habitat_event) table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
{| class="wikitable"
|+ Columns in "db_version"
|-
! Name !! Type !! Nullable !! Documentation
|-
| revision || integer || NO || The revision number.
|-
| updated_on || timestamp without time zone || NO || The time the upgrade was performed.
|-
| version_major || integer || NO || The major version.
|-
| version_minor || integer || NO || The minor version number.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.file"></span>
| --- | --- | --- | --- | --- |
=== Table: file ===
| name | varchar | False | None | The name of the substrate. |
| note | text | False | None | An optional description of the substrate. |
| short_code | varchar | False | None | Contains a short code that can be used to look up a substrate (e.g., during import) without relying on the primary key. |


##### Table: survey_mode <a name="rov.survey_mode"></a>
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.


This table stores "survey mode" entries from the source data. TODO: Used by [events](#rov.event) though it's not yet clear if it should stay this way.
{| class="wikitable"
|+ Columns in "file"
|-
! Name !! Type !! Nullable !! Documentation
|-
| blob_url || character varying || YES || A URL referencing the file in online blob storage. This field is subject to change depending on where the files reside and will change if they're moved.
|-
| created_on || timestamp without time zone || NO || The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
|-
| description || text || YES || An optional description for the file.
|-
| file_type_id || integer || YES || An optional reference to the [[#shared.file_type|file type]].
|-
| hash || character varying || NO || And MD5 hash of the file data. Used to compare files and search for identical versions.
|-
| metadata || jsonb || YES || A JSON dictionary containing metadata relating to the file.
|-
| name || character varying || NO || The name for the file.
|-
| path || character varying || NO || A path of the file, relative to the root directory where files are stored.
|-
| updated_on || timestamp without time zone || NO || The update time of the file record, not necessarily the file itself (this should be stored in metadata).
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.file_type"></span>
| --- | --- | --- | --- | --- |
=== Table: file_type ===
| name | varchar | False | None | The name of the survey mode. |
| note | text | False | None | An optional note about the survey mode. |
| short_code | varchar | False | None | Contains a short code that can be used to look up a survey mode (e.g., during import) without relying on the primary key. |


##### Table: thickness <a name="rov.thickness"></a>
A list of file types.


A lookup table listing the available substrate thicknesses for the [habitat_event](#rov.habitat_event) table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
{| class="wikitable"
|+ Columns in "file_type"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || The name of the file type.
|-
| short_code || character varying || NO || A short code for referencing the file type in import documents.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.library"></span>
| --- | --- | --- | --- | --- |
=== Table: library ===
| maximum | float4 | False | None | The maximum value in the range. |
| minimum | float4 | False | None | The minimum value in the range. |
| name | varchar | False | None | A characterization of biocover thickness. |
| note | text | False | None | An optional note about the biocover thickness. |
| short_code | varchar | False | None | Contains a short code that can be used to look up a thickness (e.g., during import) without relying on the primary key. |


##### Table: transect <a name="rov.transect"></a>
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.


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


| Column Name | Type | Not Null | Default | Description |
<span id="shared.mseauser"></span>
| --- | --- | --- | --- | --- |
=== Table: mseauser ===
| attributes | jsonb | False | None | A JSON column used for recording structured attributes that do not fit with the regular table structure. |
| dive_id | int4 | False | None | A reference to the [dive](#rov.dive) during which this transect occurred. |
| end_time | timestamp | False | None | The end time of the transect. |
| importsource_id | int4 | False | None | A reference to the [import source](#rov.project_import_source) from which this entity was imported. |
| name | varchar | False | None | The name of the transect. |
| note | text | False | None | An optional note about the transect. |
| objective | text | False | None | A statement of the practical or research objectives for this true. |
| start_time | timestamp | False | None | The start time of the transect. |
| summary | text | False | None | A summary of the [transect](#rov.transect); whether objectives were met, problems encountered, etc. |


##### Table: weather_observation <a name="rov.weather_observation"></a>
Represents an MSEA user and is linked to a single Django auth User. Stores extra application-related properties such as the Biigle API key.


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


| Column Name | Type | Not Null | Default | Description |
<span id="shared.organisation"></span>
| --- | --- | --- | --- | --- |
=== Table: organisation ===
| cruise_crew_id | int4 | False | None | A reference to the [cruise leg crew](#rov.cruise_leg_crew) member who is making the report. |
| cruise_id | int4 | False | None | A link to the [cruise](#rov.cruise) during which this record was recorded. |
| note | text | False | None | An optional note about the observation |
| pressure | float4 | False | None | The air pressure. |
| swell | varchar | False | None | Description of swell. |
| temperature | float4 | False | None | The air temperature. |
| time | timestamp | False | None | An optional note about the weather. |
| wind_direction | float4 | False | None | The wind direction. |
| wind_speed | float4 | False | None | The wind speed. |


##### Materialized View: cruise_track <a name="rov.cruise_track"></a>
Convenient storage for organisations involved in MSEA activities.


Constructs a geometry for each [cruise](#rov.cruise) which describes the path of the ship.
{| class="wikitable"
|+ Columns in "organisation"
|-
! Name !! Type !! Nullable !! Documentation
|-
| country || character varying || NO || The code for the country where the organisation is based (e.g., "CA" for Canada).
|-
| name || character varying || NO || The full name of the organisation.
|-
| note || text || YES || An optional note about the organisation.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.person"></span>
| --- | --- | --- | --- | --- |
=== Table: person ===
| colour | text | False | None | The a colour code generated from the cruise's ID used for cartography. |
| cruise_id | int4 | False | None | The reference to the [cruise](#rov.cruise). |
| cruise_name | text | False | None | The [cruise](#rov.cruise) name and leg. |
| geom | geometry | False | None | The cruise track geometry. |
| instrument_config_id | int4 | False | None | The reference to the [instrument configuration](#rov.instrument_config). |


##### Materialized View: dive_track <a name="rov.dive_track"></a>
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.


Constructs a geometry for each [dive](#rov.dive) which describes the path of the submersible.
{| class="wikitable"
|+ Columns in "person"
|-
! Name !! Type !! Nullable !! Documentation
|-
| affiliation || character varying || YES || The organization with which this user is currently affiliated.
|-
| biigle_user_id || integer || YES || The Biigle database ID of a user. The UUID should be used instead.
|-
| biigle_uuid || character || YES || The Biigle UUID is used to identify the user in Biigle apps.
|-
| bio || text || YES || A brief biography of the person.
|-
| email || USER-DEFINED || YES || Email address.
|-
| first_name || character varying || NO || First name.
|-
| last_name || character varying || NO || Last name.
|-
| photo || bytea || YES || A photo of the person.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.restriction"></span>
| --- | --- | --- | --- | --- |
=== Table: restriction ===
| colour | text | False | None | The a colour code generated from the cruise's ID. Used for cartography. |
| cruise_id | int4 | False | None | The reference to the [cruise](#rov.cruise). |
| cruise_name | text | False | None | The [cruise](#rov.cruise) name. |
| dive_id | int4 | False | None | The reference to the [dive](#rov.dive). |
| dive_name | varchar | False | None | The [dive](#rov.dive) name. |
| geom | geometry | False | None | The dive track geometry. |
| instrument_config_id | int4 | False | None | The reference to the [instrument configuration](#rov.instrument_config). |


##### Materialized View: evt_pos <a name="rov.evt_pos"></a>
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.


Creates a relation between an [event](#rov.event) and the [positions](#rov.position) nearest the start and end times of the event.
{| class="wikitable"
|+ Columns in "restriction"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || The date of creation of the restriction.
|-
| key || character varying || NO || The top-level property name or key.
|-
| name || character varying || NO || The name of the restriction.
|-
| note || text || YES || An optional note about the restriction.
|-
| pattern || text || NO || A pattern matching the property value using the SQL ILIKE operator. An exact (case-insensitive) match is a bare string, while appending % at any location is a wildcard match. For example, '%term' matches 'exterm' but not 'exterminate'.
|-
| updated_on || timestamp without time zone || NO || The date of last update of the restriction.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.restriction_group"></span>
| --- | --- | --- | --- | --- |
=== Table: restriction_group ===
| end_diff | interval | False | None |  |
| end_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's end time, or null if one is not supplied. |
| event_id | int4 | False | None | The link to the [event's](#rov.event)'s event ID. |
| start_diff | interval | False | None |  |
| start_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's start time. |


##### Materialized View: measurement_position <a name="rov.measurement_position"></a>
Links the restriction to a group. Members of linked groups are able to view the restricted items.


Creates a relation between a [measurement](#rov.measurement) and the temporally-nearest [position](#rov.position).
{| class="wikitable"
|+ Columns in "restriction_group"
|-
! Name !! Type !! Nullable !! Documentation
|-
| group_id || integer || NO || The ID of the Django authentication group.
|-
| restriction_id || integer || NO || The ID of the [[#rov.restriction|restriction]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.site"></span>
| --- | --- | --- | --- | --- |
=== Table: site ===
| measurement_id | int4 | False | None | The link to the [measurement](#rov.measurement). |
| position_id | int4 | False | None | The link to the [position](#rov.position). |


##### Materialized View: view_measurement_position_crosstab <a name="rov.view_measurement_position_crosstab"></a>
Contains the names and geographic boundaries of study sites. This will be useful not only for mapping but for querying data by spatial extent.


This is a pivot table containing CTD and other measurement values in individual columns. The measurement columns are not documented because they are dynamically-generated. The measurements on each row occur at the same time, while the position is the temporally-nearest one to the measurement time.
{| class="wikitable"
|+ Columns in "site"
|-
! Name !! Type !! Nullable !! Documentation
|-
| name || character varying || NO || A name for the site.
|-
| note || text || YES || An optional note about the site.
|-
| spatial_library_id || integer || YES || A reference to the [[#shared.spatial_library|spatial library]] entry.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.spatial_library"></span>
| --- | --- | --- | --- | --- |
=== Table: spatial_library ===
| Altitude (m) | float4 | False | None |  |
| Aperture (%) | float4 | False | None |  |
| Conductivity (mScm) | float4 | False | None |  |
| Conductivity (mho/cm) | float4 | False | None |  |
| Conductivity (uScm) | float4 | False | None |  |
| Density (kg/m3) | float4 | False | None |  |
| Depth (m) | float4 | False | None |  |
| Dissolved Oxygen (ml/L) | float4 | False | None |  |
| Dissolved Oxygen (umol/kg) | float4 | False | None |  |
| Field of View (cm) | float4 | False | None |  |
| Field of View (m) | float4 | False | None |  |
| Field of View Area (m2) | float4 | False | None |  |
| Fluorometry (ug/L) | float4 | False | None |  |
| Focus (%) | float4 | False | None |  |
| Heading (deg) | float4 | False | None |  |
| Oxygen Concentration (mg/L) | float4 | False | None |  |
| Oxygen Saturation (%) | float4 | False | None |  |
| Oxygen Saturation (ml/L) | float4 | False | None |  |
| Pan (deg) | float4 | False | None |  |
| Pitch (deg) | float4 | False | None |  |
| Pressure (dbar) | float4 | False | None |  |
| Pressure (psi) | float4 | False | None |  |
| Rate of Descent (m/s) | float4 | False | None |  |
| Roll (deg) | float4 | False | None |  |
| Salinity (PPT) | float4 | False | None |  |
| Salinity (PSS) | float4 | False | None |  |
| Salinity (PSU) | float4 | False | None |  |
| Sea Pressure (dbar) | float4 | False | None |  |
| Slant Range (m) | float4 | False | None |  |
| Sound Velocity (m/s) | float4 | False | None |  |
| Specific Conductivity (uScm) | float4 | False | None |  |
| Speed (kts) | float4 | False | None |  |
| Speed (m/s) | float4 | False | None |  |
| Temperature (deg C) | float4 | False | None |  |
| Tilt (deg) | float4 | False | None |  |
| Turbidity (ftu) | float4 | False | None |  |
| Zoom (%) | float4 | False | None |  |
| cruise_name | varchar | False | None | The dive name -- a convenience. |
| dive_name | varchar | False | None | The dive name -- a convenience. |
| geom | geography | False | None | The point geometry of the position. |
| lat | float4 | False | None | The latitude of the position. |
| lon | float4 | False | None | The longitude of the position. |
| tdiff | float4 | False | None | The time difference in seconds between the measurement time and the position time. |
| timestamp | timestamp | False | None | The measurement time. |


##### View: comment_event_position <a name="rov.comment_event_position"></a>
Maintains a library of spatial data.


Creates a relation between an [comment event](#rov.comment_event) and the [positions](#rov.position) nearest the start and end times of the event.
{| class="wikitable"
|+ Columns in "spatial_library"
|-
! Name !! Type !! Nullable !! Documentation
|-
| created_on || timestamp without time zone || NO || The time when this record was created.
|-
| file_id || integer || YES || A reference to a related [[#shared.file|file]].
|-
| geom || geometry || YES || A vector representation of the object(s), projected into WGS84 (lat/lon) and stored as a geography type.
|-
| metadata || jsonb || YES || A JSON object containing metadata related to the spatial object.
|-
| name || character varying || NO || A name for the entry.
|-
| note || text || YES || A note about this library item.
|-
| rast || bytea || YES || A raster.
|-
| thumbnail || bytea || YES || A small thumbnail in binary (JPG) form.
|-
| updated_on || timestamp without time zone || NO || The date of update of this record.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.spatial_library_file"></span>
| --- | --- | --- | --- | --- |
=== Table: spatial_library_file ===
| end_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's end time, or null if one is not supplied. |
| event_id | int4 | False | None | The link to the [comment event's](#rov.comment_event)'s event ID. |
| start_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's start time. |


##### View: habitat_event_position <a name="rov.habitat_event_position"></a>
Allows a [[#shared.spatial_library|spatial library]] entity to own more than one file.


Creates a relation between an [habitat event](#rov.habitat_event) and the [positions](#rov.position) nearest the start and end times of the event.
{| 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]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="shared.uploaded_file"></span>
| --- | --- | --- | --- | --- |
=== Table: uploaded_file ===
| end_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's end time, or null if one is not supplied. |
| event_id | int4 | False | None | The link to the [habitat event's](#rov.habitat_event)'s event ID. |
| start_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's start time. |


##### View: observation_event_position <a name="rov.observation_event_position"></a>
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.
 
Creates a relation between an [observation event](#rov.observation_event) and the [positions](#rov.position) nearest the start and end times of the event.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| end_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's end time, or null if one is not supplied. |
| event_id | int4 | False | None | The link to the [observation event's](#rov.observation_event)'s event ID. |
| start_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's start time. |
 
##### View: status_event_position <a name="rov.status_event_position"></a>
 
Creates a relation between an [status event](#rov.status_event) and the [positions](#rov.position) nearest the start and end times of the event.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| end_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's end time, or null if one is not supplied. |
| event_id | int4 | False | None | The link to the [status event's](#rov.status_event)'s event ID. |
| start_position_id | int4 | False | None | The link to the [position](#rov.position) nearest the event's start time. |
 
#### Schema: ndst
 
##### Table: cruise <a name="ndst.cruise"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| active | bool | False | None |  |
| created_on | timestamp | False | None |  |
| leg | text | False | None |  |
| name | text | False | None |  |
| note | text | False | None |  |
| objective | text | False | None |  |
| row_id | text | False | None |  |
| status | varchar | False | None |  |
| summary | text | False | None |  |
| updated_on | timestamp | False | None |  |
 
##### Table: diveconfig <a name="ndst.diveconfig"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| active | bool | False | None |  |
| name | text | False | None |  |
| note | text | False | None |  |
| row_id | text | False | None |  |
| ship_config | text | False | None |  |
| ship_instrument_configs | text | False | None |  |
| sub_config | text | False | None |  |
| sub_instrument_configs | text | False | None |  |
 
##### Table: dives <a name="ndst.dives"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| active | bool | False | None |  |
| cruise_name | text | False | None |  |
| dive_config | text | False | None |  |
| end_time | text | False | None |  |
| leg | text | False | None |  |
| name | text | False | None |  |
| note | text | False | None |  |
| objective | text | False | None |  |
| pilot | text | False | None |  |
| row_id | text | False | None |  |
| site_name | text | False | None |  |
| start_time | text | False | None |  |
| summary | text | False | None |  |
 
##### Table: equipconfig <a name="ndst.equipconfig"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| active | bool | False | None |  |
| configuration | text | False | None |  |
| name | text | False | None |  |
| note | text | False | None |  |
| row_id | text | False | None |  |
| short_code | text | False | None |  |
| type | text | False | None |  |
 
##### Table: equipment <a name="ndst.equipment"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| active | bool | False | None |  |
| brand | text | False | None |  |
| instrument_id | int4 | False | None |  |
| model | text | False | None |  |
| note | text | False | None |  |
| platform_id | int4 | False | None |  |
| row_id | text | False | None |  |
| serial_number | text | False | None |  |
| short_code | text | False | None |  |
| short_code_mapped | varchar | False | None | 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 | False | None |  |
 
##### Table: people <a name="ndst.people"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| active | bool | False | None |  |
| email | text | False | None |  |
| first_name | text | False | None |  |
| initials | text | False | None |  |
| last_name | text | False | None |  |
| person_id | int4 | False | None |  |
| row_id | text | False | None |  |
 
##### Table: transects <a name="ndst.transects"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| active | bool | False | None |  |
| cruise_name | text | False | None |  |
| dive_name | text | False | None |  |
| end_time | text | False | None |  |
| leg | text | False | None |  |
| name | text | False | None |  |
| note | text | False | None |  |
| objective | text | False | None |  |
| row_id | text | False | None |  |
| start_time | text | False | None |  |
| summary | text | False | None |  |
 
#### Schema:
 
### Protected Areas
 
These tables relate to protected areas.
 
#### Schema: pa
 
##### Table: mpa <a name="pa.mpa"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| aichi_t11 | varchar | False | None |  |
| biome | varchar | False | None |  |
| comments | varchar | False | None |  |
| delisdate | int4 | False | None |  |
| geom | geography | False | None |  |
| geometry | geometry | False | None |  |
| gov_type | varchar | False | None |  |
| iucn_cat | varchar | False | None |  |
| jur_id | varchar | False | None |  |
| legisl_e | varchar | False | None |  |
| legisl_f | varchar | False | None |  |
| loc_e | varchar | False | None |  |
| loc_f | varchar | False | None |  |
| mgmt_e | varchar | False | None |  |
| mgmt_f | varchar | False | None |  |
| name_e | varchar | False | None |  |
| name_f | varchar | False | None |  |
| name_ind | varchar | False | None |  |
| o_area | float8 | False | None |  |
| objectid | int8 | False | None |  |
| oecm | varchar | False | None |  |
| ogc_fid | int4 | False | None |  |
| owner_e | varchar | False | None |  |
| owner_f | varchar | False | None |  |
| parent_id | int4 | False | None |  |
| protdate | int4 | False | None |  |
| shape_area | float8 | False | None |  |
| shape_length | float8 | False | None |  |
| status_e | varchar | False | None |  |
| status_f | varchar | False | None |  |
| subs_right | varchar | False | None |  |
| type_e | varchar | False | None |  |
| type_f | varchar | False | None |  |
| url | varchar | False | None |  |
| zone_id | int4 | False | None |  |
| zonedesc_e | varchar | False | None |  |
| zonedesc_f | varchar | False | None |  |
 
##### Table: mpa_data_object <a name="pa.mpa_data_object"></a>
 
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.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| created_on | timestamp | False | None | The time of creation of the record. |
| description | text | False | None | A description of the object. |
| doi | varchar | False | None | The DOI of the object. |
| isbn | varchar | False | None | The ISBN of the object. |
| mpa_id | int4 | False | None | A reference to the [MPA](#mpa.mpa) record. |
| name | varchar | False | None | The name of the data object. |
| updated_on | timestamp | False | None | The last update time of the object. |
 
##### Table: mpa_data_object_file <a name="pa.mpa_data_object_file"></a>
 
Gives the ability for more than one [data object](#mpa.data_object) to own a [file](#shared.file) and vice versa.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| data_object_id | int4 | False | None | A reference to the [data object](#mpa.data_object). |
| file_id | int4 | False | None | A reference to the [file](#shared.file). |
 
##### Table: protected_area <a name="pa.protected_area"></a>
 
A unified table for protected areas.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| area | float4 | False | None | The nominal area in sq. km of the protected area. |
| geom | geography | False | None | The boundary geometry of the protected area. |
| name_e | varchar | False | None | The English name of the protected area. |
| name_f | varchar | False | None | The French name of the protected area. |
| note | text | False | None | An optional note about the protected area. |
| original_id | int4 | False | None | The original ID of the protected area, from the source database. |
| type | varchar | False | None | The type of protected area, including "RCA", "MPA", etc. |
| year_created | int4 | False | None | The year of creation of the protected area. |
 
##### Table: protected_area_data_object <a name="pa.protected_area_data_object"></a>
 
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.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| created_on | timestamp | False | None | The time of creation of the record. |
| description | text | False | None | A description of the object. |
| doi | varchar | False | None | The DOI of the object. |
| isbn | varchar | False | None | The ISBN of the object. |
| name | varchar | False | None | The name of the data object. |
| protected_area_id | int4 | False | None | A link to the [protected area](#pa.protected_area). |
| updated_on | timestamp | False | None | The last update time of the object. |
 
##### Table: protected_area_data_object_file <a name="pa.protected_area_data_object_file"></a>
 
Gives the ability for more than one [data object](#rca.data_object) to own a [file](#shared.file) and vice versa.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| data_object_id | int4 | False | None | A reference to the [data object](#rca.data_object). |
| file_id | int4 | False | None | A reference to the [file](#shared.file). |
 
##### Table: rca <a name="pa.rca"></a>
 
Stores basic information about RCAs along with a boundary geometry.
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| area | float4 | False | None | The area of the RCA (from source). |
| description | text | False | None | A description of the RCA. |
| formerid | int2 | False | None | The former ID of the RCA (from source). |
| geom | geography | False | None | The RCA geography. |
| hectares | float4 | False | None | The number of hectares in the RCA (from source). |
| len | float4 | False | None | The length (?) of the RCA (from source). |
| name | varchar | False | None | The name of the RCA. |
| rca_id | float8 | False | None | The RCA ID as defined by the provider. |
| sq_km | float4 | False | None | The area of the RCA (from source). |
| yr_created | int2 | False | None | The year the RCA was created (from source). |
 
### Wiki
 
These tables are owned by the Mediawiki installation.
 
#### Schema: wiki
 
##### Table: actor <a name="wiki.actor"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| actor_id | int8 | False | None |  |
| actor_name | text | False | None |  |
| actor_user | int4 | False | None |  |
 
##### Table: archive <a name="wiki.archive"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ar_actor | int8 | False | None |  |
| ar_comment_id | int8 | False | None |  |
| ar_deleted | int2 | False | None |  |
| ar_id | int4 | False | None |  |
| ar_len | int4 | False | None |  |
| ar_minor_edit | int2 | False | None |  |
| ar_namespace | int4 | False | None |  |
| ar_page_id | int4 | False | None |  |
| ar_parent_id | int4 | False | None |  |
| ar_rev_id | int4 | False | None |  |
| ar_sha1 | text | False | None |  |
| ar_timestamp | timestamptz | False | None |  |
| ar_title | text | False | None |  |
 
##### Table: bot_passwords <a name="wiki.bot_passwords"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| bp_app_id | text | False | None |  |
| bp_grants | text | False | None |  |
| bp_password | text | False | None |  |
| bp_restrictions | text | False | None |  |
| bp_token | text | False | None |  |
| bp_user | int4 | False | None |  |
 
##### Table: category <a name="wiki.category"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| cat_files | int4 | False | None |  |
| cat_id | int4 | False | None |  |
| cat_pages | int4 | False | None |  |
| cat_subcats | int4 | False | None |  |
| cat_title | text | False | None |  |
 
##### Table: categorylinks <a name="wiki.categorylinks"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| cl_collation | text | False | None |  |
| cl_from | int4 | False | None |  |
| cl_sortkey | text | False | None |  |
| cl_sortkey_prefix | text | False | None |  |
| cl_timestamp | timestamptz | False | None |  |
| cl_to | text | False | None |  |
| cl_type | text | False | None |  |
 
##### Table: change_tag <a name="wiki.change_tag"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ct_id | int4 | False | None |  |
| ct_log_id | int4 | False | None |  |
| ct_params | text | False | None |  |
| ct_rc_id | int4 | False | None |  |
| ct_rev_id | int4 | False | None |  |
| ct_tag_id | int4 | False | None |  |
 
##### Table: change_tag_def <a name="wiki.change_tag_def"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ctd_count | int8 | False | None |  |
| ctd_id | int4 | False | None |  |
| ctd_name | text | False | None |  |
| ctd_user_defined | int2 | False | None |  |
 
##### Table: comment <a name="wiki.comment"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| comment_data | text | False | None |  |
| comment_hash | int4 | False | None |  |
| comment_id | int8 | False | None |  |
| comment_text | text | False | None |  |
 
##### Table: content <a name="wiki.content"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| content_address | text | False | None |  |
| content_id | int8 | False | None |  |
| content_model | int2 | False | None |  |
| content_sha1 | text | False | None |  |
| content_size | int4 | False | None |  |
 
##### Table: content_models <a name="wiki.content_models"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| model_id | int4 | False | None |  |
| model_name | text | False | None |  |
 
##### Table: externallinks <a name="wiki.externallinks"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| el_from | int4 | False | None |  |
| el_id | int4 | False | None |  |
| el_index | text | False | None |  |
| el_index_60 | text | False | None |  |
| el_to | text | False | None |  |
| el_to_domain_index | text | False | None |  |
| el_to_path | text | False | None |  |
 
##### Table: filearchive <a name="wiki.filearchive"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| fa_actor | int8 | False | None |  |
| fa_archive_name | text | False | None |  |
| fa_bits | int4 | False | None |  |
| fa_deleted | int2 | False | None |  |
| fa_deleted_reason_id | int8 | False | None |  |
| fa_deleted_timestamp | timestamptz | False | None |  |
| fa_deleted_user | int4 | False | None |  |
| fa_description_id | int8 | False | None |  |
| fa_height | int4 | False | None |  |
| fa_id | int4 | False | None |  |
| fa_major_mime | text | False | None |  |
| fa_media_type | text | False | None |  |
| fa_metadata | text | False | None |  |
| fa_minor_mime | text | False | None |  |
| fa_name | text | False | None |  |
| fa_sha1 | text | False | None |  |
| fa_size | int4 | False | None |  |
| fa_storage_group | text | False | None |  |
| fa_storage_key | text | False | None |  |
| fa_timestamp | timestamptz | False | None |  |
| fa_width | int4 | False | None |  |
 
##### Table: image <a name="wiki.image"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| img_actor | int8 | False | None |  |
| img_bits | int4 | False | None |  |
| img_description_id | int8 | False | None |  |
| img_height | int4 | False | None |  |
| img_major_mime | text | False | None |  |
| img_media_type | text | False | None |  |
| img_metadata | text | False | None |  |
| img_minor_mime | text | False | None |  |
| img_name | text | False | None |  |
| img_sha1 | text | False | None |  |
| img_size | int4 | False | None |  |
| img_timestamp | timestamptz | False | None |  |
| img_width | int4 | False | None |  |
 
##### Table: imagelinks <a name="wiki.imagelinks"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| il_from | int4 | False | None |  |
| il_from_namespace | int4 | False | None |  |
| il_to | text | False | None |  |
 
##### Table: interwiki <a name="wiki.interwiki"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| iw_api | text | False | None |  |
| iw_local | int2 | False | None |  |
| iw_prefix | varchar | False | None |  |
| iw_trans | int2 | False | None |  |
| iw_url | text | False | None |  |
| iw_wikiid | varchar | False | None |  |
 
##### Table: ip_changes <a name="wiki.ip_changes"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ipc_hex | text | False | None |  |
| ipc_rev_id | int4 | False | None |  |
| ipc_rev_timestamp | timestamptz | False | None |  |
 
##### Table: ipblocks <a name="wiki.ipblocks"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ipb_address | text | False | None |  |
| ipb_allow_usertalk | int2 | False | None |  |
| ipb_anon_only | int2 | False | None |  |
| ipb_auto | int2 | False | None |  |
| ipb_block_email | int2 | False | None |  |
| ipb_by_actor | int8 | False | None |  |
| ipb_create_account | int2 | False | None |  |
| ipb_deleted | int2 | False | None |  |
| ipb_enable_autoblock | int2 | False | None |  |
| ipb_expiry | timestamptz | False | None |  |
| ipb_id | int4 | False | None |  |
| ipb_parent_block_id | int4 | False | None |  |
| ipb_range_end | text | False | None |  |
| ipb_range_start | text | False | None |  |
| ipb_reason_id | int8 | False | None |  |
| ipb_sitewide | int2 | False | None |  |
| ipb_timestamp | timestamptz | False | None |  |
| ipb_user | int4 | False | None |  |
 
##### Table: ipblocks_restrictions <a name="wiki.ipblocks_restrictions"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ir_ipb_id | int4 | False | None |  |
| ir_type | int2 | False | None |  |
| ir_value | int4 | False | None |  |
 
##### Table: iwlinks <a name="wiki.iwlinks"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| iwl_from | int4 | False | None |  |
| iwl_prefix | text | False | None |  |
| iwl_title | text | False | None |  |
 
##### Table: job <a name="wiki.job"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| job_attempts | int4 | False | None |  |
| job_cmd | text | False | None |  |
| job_id | int4 | False | None |  |
| job_namespace | int4 | False | None |  |
| job_params | text | False | None |  |
| job_random | int4 | False | None |  |
| job_sha1 | text | False | None |  |
| job_timestamp | timestamptz | False | None |  |
| job_title | text | False | None |  |
| job_token | text | False | None |  |
| job_token_timestamp | timestamptz | False | None |  |
 
##### Table: l10n_cache <a name="wiki.l10n_cache"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| lc_key | varchar | False | None |  |
| lc_lang | text | False | None |  |
| lc_value | text | False | None |  |
 
##### Table: langlinks <a name="wiki.langlinks"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ll_from | int4 | False | None |  |
| ll_lang | text | False | None |  |
| ll_title | text | False | None |  |
 
##### Table: linktarget <a name="wiki.linktarget"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| lt_id | int8 | False | None |  |
| lt_namespace | int4 | False | None |  |
| lt_title | text | False | None |  |
 
##### Table: log_search <a name="wiki.log_search"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ls_field | text | False | None |  |
| ls_log_id | int4 | False | None |  |
| ls_value | varchar | False | None |  |
 
##### Table: logging <a name="wiki.logging"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| log_action | text | False | None |  |
| log_actor | int8 | False | None |  |
| log_comment_id | int8 | False | None |  |
| log_deleted | int2 | False | None |  |
| log_id | int4 | False | None |  |
| log_namespace | int4 | False | None |  |
| log_page | int4 | False | None |  |
| log_params | text | False | None |  |
| log_timestamp | timestamptz | False | None |  |
| log_title | text | False | None |  |
| log_type | text | False | None |  |
 
##### Table: module_deps <a name="wiki.module_deps"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| md_deps | text | False | None |  |
| md_module | text | False | None |  |
| md_skin | text | False | None |  |
 
##### Table: objectcache <a name="wiki.objectcache"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| exptime | timestamptz | False | None |  |
| flags | int4 | False | None |  |
| keyname | text | False | None |  |
| modtoken | varchar | False | None |  |
| value | text | False | None |  |
 
##### Table: oldimage <a name="wiki.oldimage"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| oi_actor | int8 | False | None |  |
| oi_archive_name | text | False | None |  |
| oi_bits | int4 | False | None |  |
| oi_deleted | int2 | False | None |  |
| oi_description_id | int8 | False | None |  |
| oi_height | int4 | False | None |  |
| oi_major_mime | text | False | None |  |
| oi_media_type | text | False | None |  |
| oi_metadata | text | False | None |  |
| oi_minor_mime | text | False | None |  |
| oi_name | text | False | None |  |
| oi_sha1 | text | False | None |  |
| oi_size | int4 | False | None |  |
| oi_timestamp | timestamptz | False | None |  |
| oi_width | int4 | False | None |  |
 
##### Table: page <a name="wiki.page"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| page_content_model | text | False | None |  |
| page_id | int4 | False | None |  |
| page_is_new | int2 | False | None |  |
| page_is_redirect | int2 | False | None |  |
| page_lang | text | False | None |  |
| page_latest | int4 | False | None |  |
| page_len | int4 | False | None |  |
| page_links_updated | timestamptz | False | None |  |
| page_namespace | int4 | False | None |  |
| page_random | float8 | False | None |  |
| page_title | text | False | None |  |
| page_touched | timestamptz | False | None |  |
| titlevector | tsvector | False | None |  |
 
##### Table: page_props <a name="wiki.page_props"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| pp_page | int4 | False | None |  |
| pp_propname | text | False | None |  |
| pp_sortkey | float8 | False | None |  |
| pp_value | text | False | None |  |
 
##### Table: page_restrictions <a name="wiki.page_restrictions"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| pr_cascade | int2 | False | None |  |
| pr_expiry | timestamptz | False | None |  |
| pr_id | int4 | False | None |  |
| pr_level | text | False | None |  |
| pr_page | int4 | False | None |  |
| pr_type | text | False | None |  |
 
##### Table: pagelinks <a name="wiki.pagelinks"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| pl_from | int4 | False | None |  |
| pl_from_namespace | int4 | False | None |  |
| pl_namespace | int4 | False | None |  |
| pl_title | text | False | None |  |
 
##### Table: protected_titles <a name="wiki.protected_titles"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| pt_create_perm | text | False | None |  |
| pt_expiry | timestamptz | False | None |  |
| pt_namespace | int4 | False | None |  |
| pt_reason_id | int8 | False | None |  |
| pt_timestamp | timestamptz | False | None |  |
| pt_title | text | False | None |  |
| pt_user | int4 | False | None |  |
 
##### Table: querycache <a name="wiki.querycache"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| qc_namespace | int4 | False | None |  |
| qc_title | text | False | None |  |
| qc_type | text | False | None |  |
| qc_value | int4 | False | None |  |
 
##### Table: querycache_info <a name="wiki.querycache_info"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| qci_timestamp | timestamptz | False | None |  |
| qci_type | text | False | None |  |
 
##### Table: querycachetwo <a name="wiki.querycachetwo"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| qcc_namespace | int4 | False | None |  |
| qcc_namespacetwo | int4 | False | None |  |
| qcc_title | text | False | None |  |
| qcc_titletwo | text | False | None |  |
| qcc_type | text | False | None |  |
| qcc_value | int4 | False | None |  |
 
##### Table: recentchanges <a name="wiki.recentchanges"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| rc_actor | int8 | False | None |  |
| rc_bot | int2 | False | None |  |
| rc_comment_id | int8 | False | None |  |
| rc_cur_id | int4 | False | None |  |
| rc_deleted | int2 | False | None |  |
| rc_id | int4 | False | None |  |
| rc_ip | text | False | None |  |
| rc_last_oldid | int4 | False | None |  |
| rc_log_action | text | False | None |  |
| rc_log_type | text | False | None |  |
| rc_logid | int4 | False | None |  |
| rc_minor | int2 | False | None |  |
| rc_namespace | int4 | False | None |  |
| rc_new | int2 | False | None |  |
| rc_new_len | int4 | False | None |  |
| rc_old_len | int4 | False | None |  |
| rc_params | text | False | None |  |
| rc_patrolled | int2 | False | None |  |
| rc_source | text | False | None |  |
| rc_this_oldid | int4 | False | None |  |
| rc_timestamp | timestamptz | False | None |  |
| rc_title | text | False | None |  |
| rc_type | int2 | False | None |  |
 
##### Table: redirect <a name="wiki.redirect"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| rd_fragment | text | False | None |  |
| rd_from | int4 | False | None |  |
| rd_interwiki | varchar | False | None |  |
| rd_namespace | int4 | False | None |  |
| rd_title | text | False | None |  |
 
##### Table: revision <a name="wiki.revision"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| rev_actor | int8 | False | None |  |
| rev_comment_id | int8 | False | None |  |
| rev_deleted | int2 | False | None |  |
| rev_id | int4 | False | None |  |
| rev_len | int4 | False | None |  |
| rev_minor_edit | int2 | False | None |  |
| rev_page | int4 | False | None |  |
| rev_parent_id | int4 | False | None |  |
| rev_sha1 | text | False | None |  |
| rev_timestamp | timestamptz | False | None |  |
 
##### Table: revision_comment_temp <a name="wiki.revision_comment_temp"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| revcomment_comment_id | int8 | False | None |  |
| revcomment_rev | int4 | False | None |  |
 
##### Table: searchindex <a name="wiki.searchindex"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| si_page | int4 | False | None |  |
| si_text | text | False | None |  |
| si_title | varchar | False | None |  |
 
##### Table: site_identifiers <a name="wiki.site_identifiers"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| si_key | text | False | None |  |
| si_site | int4 | False | None |  |
| si_type | text | False | None |  |
 
##### Table: site_stats <a name="wiki.site_stats"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ss_active_users | int8 | False | None |  |
| ss_good_articles | int8 | False | None |  |
| ss_images | int8 | False | None |  |
| ss_row_id | int4 | False | None |  |
| ss_total_edits | int8 | False | None |  |
| ss_total_pages | int8 | False | None |  |
| ss_users | int8 | False | None |  |
 
##### Table: sites <a name="wiki.sites"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| site_config | text | False | None |  |
| site_data | text | False | None |  |
| site_domain | varchar | False | None |  |
| site_forward | int2 | False | None |  |
| site_global_key | text | False | None |  |
| site_group | text | False | None |  |
| site_id | int4 | False | None |  |
| site_language | text | False | None |  |
| site_protocol | text | False | None |  |
| site_source | text | False | None |  |
| site_type | text | False | None |  |
 
##### Table: slot_roles <a name="wiki.slot_roles"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| role_id | int4 | False | None |  |
| role_name | text | False | None |  |
 
##### Table: slots <a name="wiki.slots"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| slot_content_id | int8 | False | None |  |
| slot_origin | int8 | False | None |  |
| slot_revision_id | int8 | False | None |  |
| slot_role_id | int2 | False | None |  |
 
##### Table: templatelinks <a name="wiki.templatelinks"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| tl_from | int4 | False | None |  |
| tl_from_namespace | int4 | False | None |  |
| tl_target_id | int8 | False | None |  |
 
##### Table: text <a name="wiki.text"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| old_flags | text | False | None |  |
| old_id | int4 | False | None |  |
| old_text | text | False | None |  |
| textvector | tsvector | False | None |  |
 
##### Table: updatelog <a name="wiki.updatelog"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ul_key | varchar | False | None |  |
| ul_value | text | False | None |  |
 
##### Table: uploadstash <a name="wiki.uploadstash"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| us_chunk_inx | int4 | False | None |  |
| us_id | int4 | False | None |  |
| us_image_bits | int2 | False | None |  |
| us_image_height | int4 | False | None |  |
| us_image_width | int4 | False | None |  |
| us_key | varchar | False | None |  |
| us_media_type | us_media_type_enum | False | None |  |
| us_mime | varchar | False | None |  |
| us_orig_path | varchar | False | None |  |
| us_path | varchar | False | None |  |
| us_props | text | False | None |  |
| us_sha1 | varchar | False | None |  |
| us_size | int4 | False | None |  |
| us_source_type | varchar | False | None |  |
| us_status | varchar | False | None |  |
| us_timestamp | timestamptz | False | None |  |
| us_user | int4 | False | None |  |
 
##### Table: user <a name="wiki.user"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| user_editcount | int4 | False | None |  |
| user_email | text | False | None |  |
| user_email_authenticated | timestamptz | False | None |  |
| user_email_token | text | False | None |  |
| user_email_token_expires | timestamptz | False | None |  |
| user_id | int4 | False | None |  |
| user_name | text | False | None |  |
| user_newpass_time | timestamptz | False | None |  |
| user_newpassword | text | False | None |  |
| user_password | text | False | None |  |
| user_password_expires | timestamptz | False | None |  |
| user_real_name | text | False | None |  |
| user_registration | timestamptz | False | None |  |
| user_token | text | False | None |  |
| user_touched | timestamptz | False | None |  |
 
##### Table: user_autocreate_serial <a name="wiki.user_autocreate_serial"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| uas_shard | int4 | False | None |  |
| uas_value | int4 | False | None |  |
 
##### Table: user_former_groups <a name="wiki.user_former_groups"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ufg_group | text | False | None |  |
| ufg_user | int4 | False | None |  |
 
##### Table: user_groups <a name="wiki.user_groups"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| ug_expiry | timestamptz | False | None |  |
| ug_group | text | False | None |  |
| ug_user | int4 | False | None |  |
 
##### Table: user_newtalk <a name="wiki.user_newtalk"></a>
 
| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| user_id | int4 | False | None |  |
| user_ip | text | False | None |  |
| user_last_timestamp | timestamptz | False | None |  |
 
##### Table: user_properties <a name="wiki.user_properties"></a>


| Column Name | Type | Not Null | Default | Description |
{| class="wikitable"
| --- | --- | --- | --- | --- |
|+ Columns in "uploaded_file"
| up_property | text | False | None | |
|-
| up_user | int4 | False | None | |
! Name !! Type !! Nullable !! Documentation
| up_value | text | False | None | |
|-
| created_on || timestamp without time zone || NO || The time of creation of the record.
|-
| expires_on || timestamp without time zone || NO || The expiry time of the file. It may be deleted by a maintenance script after this time.
|-
| marked_for_delete || boolean || NO || If true, the file is marked for delete. Otherwise it will not be touched unless there is an age limit set in the daemon.
|-
| name || character varying || NO || The original name of the file.
|-
| path || character varying || NO || The path to the temporary location of the file.
|-
| type || character varying || NO || The guessed MIME type of the file.
|}


##### Table: watchlist <a name="wiki.watchlist"></a>  
<span id="taxonomy"></span>
== Schema: taxonomy ==


| Column Name | Type | Not Null | Default | Description |
<span id="taxonomy.taxon"></span>
| --- | --- | --- | --- | --- |
=== Table: taxon ===
| wl_id | int4 | False | None |  |
| wl_namespace | int4 | False | None |  |
| wl_notificationtimestamp | timestamptz | False | None |  |
| wl_title | text | False | None |  |
| wl_user | int4 | False | None |  |


##### Table: watchlist_expiry <a name="wiki.watchlist_expiry"></a>
Stores taxonomic names from a variety of databases in a common format distinguished by source and taxon_id.


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




</markdown>
<!-- END GENERATED CONTENT -->
<!-- END GENERATED CONTENT -->

Latest revision as of 03:34, 22 June 2025

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

Notes About Specific Entities

These notes about specific entities complement the generated documentation below.

rov.dive and rov.transect

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

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

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

Generated Documentation

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

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

  • Schema
    • Table
    • Materialized View
    • View

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

Database Comments

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

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

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

Generated Entity Documentation

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

Schema: intertidal

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

Table: quadrat

A record of observations within an intertidal quadrat.

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

Table: quadrat_observation

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

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

Table: quadrat_substrate

List substrates observed in intertidal quadrats.

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

Table: quadrat_substrate_coverage

Associates quadrat substrate coverages with quadrats.

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

Table: survey

Stores metadata about intertidal surveys.

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

Table: survey_crew

Associates intertidal survey crew members with roles.

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

Table: survey_role

A list of roles available to intertidal survey crew members.

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

Table: survey_taxon

Links taxon records to intertidal surveys.

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

Schema: ndst

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

Table: cruise

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

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

Table: diveconfig

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

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

Table: dives

Stores information about each dive.

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

Table: equipconfig

Stores configurations for equipment, including instruments and platforms.

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

Table: equipment

Stores equipment, including instruments and platforms.

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

Table: people

Stores the people who worked on the cruise.

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

Table: transects

Stores information about each transect.

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

Schema: rov

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

Table: abundance

Stores a list of abundance labels from the ACFOR scale.

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

Table: annotation_job

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

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

Table: annotation_job_annotation_protocol

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

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

Table: annotation_job_crew

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

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

Table: annotation_job_role

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

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

Table: annotation_protocol

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

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

Table: annotation_protocol_document

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

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

Table: annotation_software

The software used for annotation.

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

Table: biigle_label_map

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

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

Table: biigle_label_map_restriction

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

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

Table: biocover

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

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

Table: complexity

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

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

Table: coverage

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

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

Table: cruise

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

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

Table: cruise_crew

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

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

Table: cruise_document

Stores information about documents related to a cruise.

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

Table: cruise_fn_contact

A table for associating First Nations contacts with a cruise.

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

Table: cruise_import

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

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

Table: cruise_library

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

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

Table: cruise_program

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

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

Table: cruise_role

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

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

Table: disturbance

Provides a nominal level of disturbance for habitat events.

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

Table: dive

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

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

Table: dive_crew

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

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

Table: dive_role

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

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

Table: equipment_type

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

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

Table: event

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

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

Table: event_logger

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

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

Table: flow

Stores categories of current flow for habitat.

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

Table: generic_label_map

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

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

Table: generic_label_map_restriction

Links a generic label mapping to a restriction.

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

Table: image_quality

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

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

Table: import_queue_annotator

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

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

Table: import_queue_annotator_label_map_prefill

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

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

Table: import_queue_pi

Stores the import packages created by principal investigators.

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

Table: instrument

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

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

Table: instrument_config

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

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

Table: measurement

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

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

Table: measurement_type

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

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

Table: medium_format

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

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

Table: medium_type

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

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

Table: model

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

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

Table: model_documentation

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

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

Table: model_equipment_type

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

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

Table: observation_confidence

Provides a nominal observation confidence level for observation events.

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

Table: orientation

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

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

Table: orientation_type

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

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

Table: platform

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

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

Table: platform_config

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

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

Table: position

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

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

Table: position_type

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

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

Table: program

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

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

Table: program_library

A table to associate programs with library documents.

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

Table: program_member

Assigns user roles to a program.

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

Table: program_role

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

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

Table: protocol

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

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

Table: relief

Provides a nominal level of terrain relief for habitat events.

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

Table: signup_area

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

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

Table: status_type

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

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

Table: status_type_detail

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

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

Table: substrate

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

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

Table: survey_mode

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

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

Table: thickness

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

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

Table: transect

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

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

Table: weather_observation

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

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

Schema: shared

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

Table: db_version

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

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

Table: file

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

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

Table: file_type

A list of file types.

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

Table: library

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

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

Table: mseauser

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

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

Table: organisation

Convenient storage for organisations involved in MSEA activities.

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

Table: person

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

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

Table: restriction

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

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

Table: restriction_group

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

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

Table: site

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

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

Table: spatial_library

Maintains a library of spatial data.

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

Table: spatial_library_file

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

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

Table: uploaded_file

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

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

Schema: taxonomy

Table: taxon

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

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