Annotation Database Entity Documentation: Difference between revisions

From MediaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(44 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page contains database entity documentation 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].
Database entity documentation is generated automatically from the production database by the Django task, [https://gitlab.com/rskelly/msea-services/-/blob/main/services/shared/tasks/db_documentation.py db_documentation.py]. The script automatically modifies this page, replacing the text between the <!-- BEGIN GENERATED CONTENT --> and <!-- END GENERATED CONTENT --> tags.


The documentation is arranged into conceptual groupings with the following structure.
Documentation resides in the database itself, in the form of comments on the relations and columns, and can be created by executing SQL statements in the form,


* Grouping
    COMMENT ON SHCEMA [schema] IS 'This is a schema comment.';
** Schema
    COMMENT ON TABLE [schema].[table name] IS 'This is a table comment.';
*** Table
    COMMENT ON COLUMN [schema].[table name].[column name] IS 'This is a column comment.';
*** Materialized View
*** View


System and Django tables aren't included. The ID column of each table is also excluded.
Comments on MSEA's tables are managed using DDL, as described on the [[Annotation_Database#Database_Upgrades|Database Upgrades]] page. Many other tables are generated by application frameworks and are not documented.
 
''Note: this page is auto-generated from the documentation comments in the actual database. Do not edit it directly.''


<!-- BEGIN GENERATED CONTENT -->
<!-- BEGIN GENERATED CONTENT -->
<markdown>
<span id="{schema}"></span>


## Groups
== Schema: admin ==


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


These are shared tables used by other tables in other schemas.
=== Tables ===


#### shared
<span id="admin.cache_table"></span>


==== cache_table ====


##### db_version
A table containing information about cache refreshment procedures and the tables they impact. The cache_refresh_tables procedure will read this table and execute the procedures stored therein.
 
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| table_name
| Stores the name of the table impacted by the associated cache procedure. Triggers will be disabled on the table, then re-enabled.
|-
| proc_name
| The name of the cache refresh procedure to be called.
|-
| created_on
|
|-
| updated_on
|
|}


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


| Column Name | Type | Not Null | Default | Description |
<span id="{schema}"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### file <a name="shared.file" />
== Schema: cache ==


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.
Contains cached representations of data tables, intended bypass complex joins to speed data extraction and improve user experience.


| Column Name | Type | Not Null | Default | Description |
=== Tables ===
| --- | --- | --- | --- | --- |
| 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). |


##### file_type <a name="shared.file_type" />
<span id="cache.cruise_stats"></span>


A list of file types.
==== cruise_stats ====


| Column Name | Type | Not Null | Default | Description |
Stores compiled statistics for [[#rov.cruise|cruises]].
| --- | --- | --- | --- | --- |
| 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. |


##### hart_taxon <a name="shared.hart_taxon" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| cruise_id
| The ID of the [[#rov.cruise|cruise]].
|-
| name
| The name of the [[#rov.cruise|cruise]].
|-
| leg
| The [[#rov.cruise|cruise]] leg.
|-
| start_date
| The start date of the [[#rov.cruise|cruise]].
|-
| end_date
| The end date of the [[#rov.cruise|cruise]].
|-
| num_dives
| The number of dives performed during the [[#rov.cruise|cruise]].
|-
| num_measurements
| The number measurements collected during the [[#rov.cruise|cruise]].
|-
| num_positions
| The number positions collected during the [[#rov.cruise|cruise]].
|-
| num_habitats
| The number habitats annotated during the [[#rov.cruise|cruise]].
|-
| num_observations
| The number observations annotated during the [[#rov.cruise|cruise]].
|-
| is_approved
|
|-
| num_transects
| The number of [[#rov.transect|transects]] that occurred during this [[#rov.cruise|cruise]].
|-
| num_taxa
| The number of [[#taxonomy.taxon|taxa]] observed during this [[#rov.cruise|cruise]].
|-
| num_cruise_crew
| The number of [[#rov.cruise_crew|crew members]] configured for this [[#rov.cruise|cruise]].
|-
| num_dive_crew
| The number of [[#rov.dive_crew|crew members]] configured for the [[#rov.dive|dives]] of this [[#rov.cruise|cruise]].
|-
| num_ap_docs
| The number of [[#rov.annotation_protocol_document|documents]] attached to an [[#rov.annotation_protocol|annotation protocol]] used to annotate this [[#rov.cruise|cruise's]] data.
|-
| num_cruise_docs
| True if there is at least one [[#rov.cruise_document|document]] attached this [[#rov.cruise|cruise]].
|-
| has_fov
| True if the cruise has field of view measurements.
|}


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.
<span id="cache.cruise_track"></span>


| Column Name | Type | Not Null | Default | Description |
==== cruise_track ====
| --- | --- | --- | --- | --- |
| 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 | ? |


##### library <a name="shared.library" />
Constructs a geometry for each [[#rov.cruise|cruise]] which describes the path of the ship.


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"
! Column
! Comment
|-
| cruise_id
| The reference to the [[#rov.cruise|cruise]].
|-
| cruise_name
| The [[#rov.cruise|cruise]] name and leg.
|-
| colour
| The a colour code generated from the cruise's ID used for cartography.
|-
| geom
| The cruise track geometry.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="cache.dive_track"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### mseauser <a name="shared.mseauser" />
==== dive_track ====


Represents an MSEA user and is linked to a single Django auth User. Stores extra application-related properties such as the Biigle API key.
Constructs a geometry for each [[#rov.dive|dive]] which describes the path of the submersible.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| biigle_api_key | varchar | False | None | The Biigle API key. |
! Comment
| 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. |
| dive_id
| user_id | int4 | False | None | A reference to the [Django user](#public.auth_user). |
| The reference to the [[#rov.dive|dive]].
|-
| cruise_id
| The reference to the [[#rov.cruise|cruise]].
|-
| dive_name
| The [[#rov.dive|dive]] name.
|-
| cruise_name
| The [[#rov.cruise|cruise]] name.
|-
| colour
| The a colour code generated from the cruise's ID. Used for cartography.
|-
| geom
| The dive track geometry.
|}


##### mseauser_restriction <a name="shared.mseauser_restriction" />
<span id="cache.evt_depth"></span>


Links an [MSEA user](#shared.mseauser) to a [restriction](#shared.restriction). The user will have access to records related to this group.
==== evt_depth ====


| Column Name | Type | Not Null | Default | Description |
Creates a relation between an [[#rov.event|event]] and the [[#rov.measurement|depth]] nearest the start and end times of the event.
| --- | --- | --- | --- | --- |
| 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. |


##### news_item <a name="shared.news_item" />
:: {| class="wikitable"
! Column
! Comment
|-
| event_id
| The link to the [[#rov.event|event's]] event ID.
|-
| instrument_config_id
| The link to the [[#rov.instrument_config|instrument configuration]].
|-
| timestamps
| The array of timestamps corresponding to the depths.
|-
| depths
| The array of [[#rov.measurement|depths]] between the event's start and end times. If the event covers a span of time, multiple depths are returned.
|}


A table for news items related to each sub-site.
<span id="cache.evt_measurement"></span>


| Column Name | Type | Not Null | Default | Description |
==== evt_measurement ====
| --- | --- | --- | --- | --- |
| 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. |


##### organisation <a name="shared.organisation" />
Creates a relation between an [[#rov.event|event]] and the [[#rov.measurement|measurement]] nearest the start and end times of the event.


Convenient storage for organisations involved in MSEA activities.
:: {| class="wikitable"
! Column
! Comment
|-
| event_id
| The link to the [[#rov.event|event's]] event ID.
|-
| instrument_config_id
| The link to the [[#rov.instrument_config|instrument configuration]].
|-
| measurement_type_id
| The link to the [[#rov.measurement_type|measurement type]].
|-
| timestamps
| The array of timestamps corresponding to the measurements.
|-
| measurements
| The array of [[#rov.measurement|measurements]] between the event's start and end times. If the event covers a span of time, multiple measurements are returned.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="cache.evt_pos"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### person <a name="shared.person" />
==== evt_pos ====


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.
Creates a relation between an [[#rov.event|event]] and the [[#rov.position|positions]] within the span of the event, as a MultiPoint.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| biigle_user_id | int4 | False | None | The Biigle database ID of a user. The UUID should be used instead. |
! Comment
| 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. |
| event_id
| email | varchar | False | None | Email address. |
| The link to the [[#rov.event|event's]]'s event ID.
| first_name | varchar | False | None | First name. |
|-
| last_name | varchar | False | None | Last name. |
| instrument_config_id
| photo | bytea | False | None | A photo of the person. |
| The link to the [[#rov.instrument_config|instrument configuration]].
|-
| timestamps
| The list of timestamps corresponding to the geometries in the geoms column.
|-
| geoms
| The list of positions comprising the ROV track during the time span of the event. A MultiPoint.
|}


##### restriction <a name="shared.restriction" />
<span id="cache.transect_track"></span>


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


| Column Name | Type | Not Null | Default | Description |
Constructs a geometry for each [[#rov.transect|transect]] which describes the path of the submersible.
| --- | --- | --- | --- | --- |
| 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. |


##### site <a name="shared.site" />
:: {| class="wikitable"
! Column
! Comment
|-
| transect_id
| The reference to the [[#rov.transect|transect]].
|-
| dive_id
| The reference to the [[#rov.dive|dive]].
|-
| cruise_id
| The reference to the [[#rov.cruise|cruise]].
|-
| transect_name
| The [[#rov.transect|transect]] name.
|-
| dive_name
| The [[#rov.dive|dive]] name.
|-
| cruise_name
| The [[#rov.cruise|cruise]] name.
|-
| colour
| The a colour code generated from the cruise's ID. Used for cartography.
|-
| geom
| The transect track geometry.
|}


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


| Column Name | Type | Not Null | Default | Description |
<span id="{schema}"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### spatial_library <a name="shared.spatial_library" />
== Schema: geo ==


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


| Column Name | Type | Not Null | Default | Description |
=== Tables ===
| --- | --- | --- | --- | --- |
| 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. |


##### spatial_library_file <a name="shared.spatial_library_file" />
<span id="geo.area"></span>


Allows a [spatial library](#shared.spatial_library) entity to own more than one file.
==== area ====


| Column Name | Type | Not Null | Default | Description |
Stores area geometries linked to [[#geo.area_group|area groups]].
| --- | --- | --- | --- | --- |
| 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). |


##### survey_suggestion <a name="shared.survey_suggestion" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| area_group_id
|
|-
| name_en
| The english name of the area.
|-
| name_fr
| The french name of the area.
|-
| properties
| A JSON object containing properties of the area.
|-
| geom
| The area geometry, a MultiPolygon.
|}


A table of suggestions supplied by users for upgrades to the database.
<span id="geo.area_group"></span>


| Column Name | Type | Not Null | Default | Description |
==== area_group ====
| --- | --- | --- | --- | --- |
| 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. |


##### taxon <a name="shared.taxon" />
Stores groups of similar areas, such as MPAs, seamounts, etc. Linked by [[#geo.area|areas]].


The taxon table stores information about the identification of observed specimens. A taxon record stores the name of the taxonomic unit (e.g., the species or genus name), or an open nomenclature (ON) identifier using *sp.* or *cf.*; an optional operational taxonomic unit (OTU), and a reference to any known taxa in the Hart, ITIS, iNaturalist or WoRMS databases. The original label stores the name as imported. The label, OTU and Hart code are updated at audit time from the original label and the scientific and common names are updated if available. The auditing process is necessary to produce reasonable data. Some of this work can be performed automatically. Multiple records in this table can refer to the same species or subspecies. It *may or may not be known whether the species referred to by a record are the same or different.* Some amount of auditing will probably be necessary on this table. The contents of this table are driven by observations; it is not populated from existing catalogues but from observations, and the authoritative entity IDs are populated as a post-processing step from existing catalogs. If a match in one of the authoritative catalogue is not found, the relation fields are left empty and the taxon should be audited, to correct spelling or assign a correct identifier.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name_en
| The english name of the area group.
|-
| name_fr
| The french name of the area group.
|-
| description_en
| The english description of the area group.
|-
| description_fr
| The french description of the area group.
|}


| Column Name | Type | Not Null | Default | Description |
| --- | --- | --- | --- | --- |
| 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. |


##### taxon_restriction <a name="shared.taxon_restriction" />
<span id="{schema}"></span>


Links an [MSEA user](#shared.mseauser) to a [restriction](#shared.restriction). The user will have access to records related to this group.
== Schema: maxmind ==


| Column Name | Type | Not Null | Default | Description |
Contains data provided by Maxmind, which provides geolocation of users based on their IP address.
| --- | --- | --- | --- | --- |
| 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. |


##### taxonomic_grouping <a name="shared.taxonomic_grouping" />
=== Tables ===


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


| Column Name | Type | Not Null | Default | Description |
==== geoip_city_blocks ====
| --- | --- | --- | --- | --- |
| 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. |


##### taxonomic_rank <a name="shared.taxonomic_rank" />
Contains both IPv4 and IPv6 network addresses, which reference locations in the [[#maxmind.geoip_city_locations|geoip_city_locations]] table.


Provides a lookup for the taxonomic rank (Kingdom, Class, Species, etc.) Used by VideoMiner.
:: {| class="wikitable"
! Column
! Comment
|-
| network
| The network address, IPv4 or IPv6.
|-
| geoname_id
| References the location ID in the [[#maxmind.geoip_city_locations|geoip_city_locations]] table.
|-
| registered_country_geoname_id
| The location ID in the [[#maxmind.geoip_city_locations|geoip_city_locations]] table which is registered to the network address.
|-
| represented_country_geoname_id
| The location ID in the [[#maxmind.geoip_city_locations|geoip_city_locations]] table from which the IP comes.
|-
| is_anonymous_proxy
| True if the address is of an anonymous proxy.
|-
| is_satellite_provider
| True if the address is used by a satellite network provider.
|-
| postal_code
| The postal code of the location.
|-
| latitude
| The latitude of the geographic center of a region, defined by the accuracy radius, which contains the location.
|-
| longitude
| The longitude of the geographic center of a region, defined by the accuracy radius, which contains the location.
|-
| accuracy_radius
| The radius (m) of a circle within which the location is located.
|-
| is_anycast
| True if the address is that of an Anycast network.
|-
| location
|
|-
| region
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="maxmind.geoip_city_locations"></span>
| --- | --- | --- | --- | --- |
| code | bpchar | False | None | A three-letter code for the rank. |
| name | varchar | False | None | The name of the taxonomic rank. |
| note | text | False | None | A note about the taxonomic rank. |


##### uploaded_file <a name="shared.uploaded_file" />
==== geoip_city_locations ====


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 the country, region and city data for GeoIP.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| created_on | timestamp | False | None | The time of creation of the record. |
! Comment
| expires_on | timestamp | False | None | The expiry time of the file. It may be deleted by a maintenance script after this time. |
|-
| name | varchar | False | None | The original name of the file. |
| geoname_id
| path | varchar | False | None | The path to the temporary location of the file. |
| The internal GeoIP city ID.
| type | varchar | False | None | The guessed MIME type of the file. |
|-
| locale_code
| The two-character local code.
|-
| continent_code
| The two-character ISO continent code.
|-
| continent_name
| The continent name
|-
| country_iso_code
| The two-character ISO country code.
|-
| country_name
| The country name
|-
| subdivision_1_iso_code
| The ISO subdivision 1 code.
|-
| subdivision_1_name
| The ISO subdivision 1 name.
|-
| subdivision_2_iso_code
| The ISO subdivision 2 code.
|-
| subdivision_2_name
| The ISO subdivision 2 name.
|-
| city_name
| The city name.
|-
| metro_code
| The three-digit metro code.
|-
| time_zone
| The name of the time zone.
|-
| is_in_european_union
| True if the location is within the European Union.
|}


### Taxonomy
<span id="maxmind.geoip_last_update"></span>


These are tables which contain external taxonomic data and are used by tables in other schemas.
==== geoip_last_update ====


#### inaturalist
Stores the time of last update of the database.


##### observation <a name="inaturalist.observation" />
:: {| class="wikitable"
! Column
! Comment
|-
| last_update
| The time of last update of the database.
|}


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.


| Column Name | Type | Not Null | Default | Description |
<span id="{schema}"></span>
| --- | --- | --- | --- | --- |
| 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. |
| 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. |
| 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? |
| iconic_taxon_name | varchar | False | None | Grouping by arbitrary taxonomic level. |
| image_url | text | False | None | A URL for an image of the observation. |
| 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. |


#### obis
== Schema: ndst ==


##### taxon <a name="obis.taxon" />
Tables related to the dive logging Shiny App used by NDST to record cruise data.


OBIS taxonomy records imported directly from the OBIS observation data, but filtered for uniqueness on the Aphia ID.
=== Tables ===


| Column Name | Type | Not Null | Default | Description |
<span id="ndst.cruise"></span>
| --- | --- | --- | --- | --- |
| 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
==== cruise ====


These are tables associated with intertidal surveys.
Contains information about a cruise, as entered by NDST staff. Will be combined with other data to populate the [[#rov.cruise|cruise]] table.


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


##### quadrat <a name="intertidal.quadrat" />
<span id="ndst.diveconfig"></span>


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


| Column Name | Type | Not Null | Default | Description |
Stores configurations for each dive, including the submersible, ship and any instruments on either.
| --- | --- | --- | --- | --- |
| 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. |


##### quadrat_observation <a name="intertidal.quadrat_observation" />
:: {| class="wikitable"
! Column
! Comment
|-
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
| name
| The name of the dive config.
|-
| ship_config
| Stores the name of the [[#ndst.equipconfig|ship configuration]] during the dive.
|-
| sub_config
| Stores the name of the [[#ndst.equipconfig|submersible configuration]] during the dive.
|-
| ship_instrument_configs
| Stores the names of the [[#ndst.equipconfig|instruments]] on the ship during the dive.
|-
| sub_instrument_configs
| Stores the names of the [[#ndst.equipconfig|instruments]] on the sub during the dive.
|-
| note
| A note about the dive config.
|-
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| id
|
|-
| created_on
| The date and time of creation of the entity.
|-
| updated_on
| The date and time of the entity's last update.
|}


Records observations within [quadrats](#intertidal.quadrat). The observation type enumeration is defined in the database export panel.
<span id="ndst.dives"></span>


| Column Name | Type | Not Null | Default | Description |
==== dives ====
| --- | --- | --- | --- | --- |
| 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. |


##### quadrat_substrate <a name="intertidal.quadrat_substrate" />
Stores information about each dive.


List substrates observed in intertidal quadrats.
:: {| class="wikitable"
! Column
! Comment
|-
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
| cruise_name
| The name of the [[#ndst.cruise|cruise]].
|-
| leg
| The leg of the [[#ndst.cruise|cruise]].
|-
| name
| The name of the dive.
|-
| pilot
| The [[#shared.person|pilot]](s) of the dive.
|-
| start_time
| The time of dive start.
|-
| end_time
| The time of dive ending.
|-
| site_name
| The name of the dive site.
|-
| dive_config
| The name of the [[#ndst.diveconfig|dive configuration]].
|-
| objective
| The objective of the dive.
|-
| summary
| A summary of the dive, its accomplishments, problems, etc.
|-
| note
| A note about the dive.
|-
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| hide
| True if the entity should be hidden in the UI.
|-
| id
|
|-
| created_on
| The date and time of creation of the entity.
|-
| updated_on
| The date and time of the entity's last update.
|}


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


##### quadrat_substrate_coverage <a name="intertidal.quadrat_substrate_coverage" />
==== equipconfig ====


Associates [quadrat substrate](#intertidal.quadrat_substrate) coverages with [quadrats](#intertidal.quadrats).
Stores configurations for [[#ndst.equipment|equipment]], including instruments and platforms.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| coverage | float4 | False | None | The coverage amount between 0% and 100%. |
! Comment
| 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). |
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
| name
| The name of the equipment config.
|-
| short_code
| A short, easy-to-use identifier for the configuration.
|-
| type
| The type of equipment.
|-
| configuration
| A JSON object containing configuration properties.
|-
| note
| A note about the equipment config.
|-
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| id
|  
|-
| created_on
| The date and time of creation of the entity.
|-
| updated_on
| The date and time of the entity's last update.
|}


##### survey <a name="intertidal.survey" />
<span id="ndst.equipment"></span>


Stores metadata about intertidal surveys.
==== equipment ====


| Column Name | Type | Not Null | Default | Description |
Stores equipment, including instruments and platforms.
| --- | --- | --- | --- | --- |
| 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. |


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


Associates [intertidal survey](#intertidal.survey) crew members with [roles](#intertidal.survey_role).
<span id="ndst.people"></span>


| Column Name | Type | Not Null | Default | Description |
==== people ====
| --- | --- | --- | --- | --- |
| 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). |


##### survey_role <a name="intertidal.survey_role" />
Stores the people who worked on the [[#ndst.cruise|cruise]].


A list of roles available to [intertidal survey crew members](#intertidal.survey_crew).
:: {| class="wikitable"
! Column
! Comment
|-
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
| initials
| The initials. Used like a short code for the person.
|-
| first_name
| The first name.
|-
| last_name
| The last name.
|-
| email
| The email address.
|-
| person_id
| The ID of the [[#shared.person|person]] in the ROV database.
|-
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| id
|
|-
| created_on
| The date and time of creation of the entity.
|-
| updated_on
| The date and time of the entity's last update.
|}


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


##### survey_taxon <a name="intertidal.survey_taxon" />
==== transects ====


Links [taxon](#shared.taxon) records to [intertidal surveys](#intertidal.survey).
Stores information about each transect.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| survey_id | int4 | False | None | A link to the [survey](#intertidal.survey). |
! Comment
| taxon_id | int4 | False | None | A link to the [taxon](#shared.taxon) record. |
|-
| row_id
| A UUID providing a universally-unique identifier for the entity.
|-
| cruise_name
| The name of the [[#ndst.cruise|cruise]].
|-
| leg
| The leg of the [[#ndst.cruise|cruise]].
|-
| dive_name
| The name of the dive.
|-
| name
| The name of the transect.
|-
| start_time
| The time of transect start.
|-
| end_time
| The time of transect ending.
|-
| objective
| The objective of the transect.
|-
| summary
| A summary of the transect, its accomplishments, problems, etc.
|-
| note
| A note about the transect.
|-
| active
| Set to true if the entity is active, that is, if it's currently being used. If not, set to false.
|-
| hide
| True if the entity should be hidden in the UI.
|-
| id
|  
|-
| created_on
| The date and time of creation of the entity.
|-
| updated_on
| The date and time of the entity's last update.
|}


#### iform


##### event_log_data <a name="iform.event_log_data" />
<span id="{schema}"></span>


| Column Name | Type | Not Null | Default | Description |
== Schema: public ==
| --- | --- | --- | --- | --- |
| content | jsonb | False | None |  |
| created_on | timestamp | False | None |  |


##### event_log <a name="iform.event_log" />
The default schema used for system tables and tables installed by application frameworks such as Django, Celery and Knox. These are generally not documented.


| Column Name | Type | Not Null | Default | Description |
=== Tables ===
| --- | --- | --- | --- | --- |
| created_date | text | False | None |  |
| created_device_id | text | False | None |  |
| event_description | text | False | None |  |
| event_time | text | False | None |  |
| event_title | text | False | None |  |
| event_type | text | False | None |  |
| modified_date | text | False | None |  |
| modified_device_id | text | False | None |  |
| notes | text | False | None |  |
| photos | text | False | None |  |
| position | text | False | None |  |
| position_json | text | False | None |  |
| recorder | text | False | None |  |
| trip_id | text | False | None |  |


### Annotation Database
<span id="public.auth_group"></span>


These are tables related to the annotation database.
==== auth_group ====


#### rov
A Django table for authorization groups.


##### abundance <a name="rov.abundance" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
|
|}


Stores a list of abundance labels from the ACFOR scale.
<span id="public.auth_group_permissions"></span>


| Column Name | Type | Not Null | Default | Description |
==== auth_group_permissions ====
| --- | --- | --- | --- | --- |
| name | varchar | False | None | A descriptive label for the abundance level. |
| note | text | False | None | An optional note about the abundance level. |
| 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. |
| 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. |


##### annotation_config <a name="rov.annotation_config" />
A Django table for permissions on authorization groups.


Links the [annotation protocol](#rov.annotation_protocol) to an [instrument configuration](#rov.instrument_config) to document how annotations were generated.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| group_id
|
|-
| permission_id
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.auth_permission"></span>
| --- | --- | --- | --- | --- |
| 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). |
| note | text | False | None | An optional note about the configuration. |


##### annotation_config_logger <a name="rov.annotation_config_logger" />
==== auth_permission ====


Associates one or more [loggers](#shared.person) with an [annotation configuration](#rov.annotation_config).
A Django table for available permissions.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| annotation_config_id | int4 | False | None | The [annotation configuration](#rov.annotation_config) that this logger belongs to. |
! Comment
| logger_id | int4 | False | None | The [person](#shared.person) responsible for generating the annotations. |
|-
| id
|  
|-
| name
|  
|-
| content_type_id
|  
|-
| codename
|  
|}


##### annotation_observation_type <a name="rov.annotation_observation_type" />
<span id="public.auth_user"></span>


Provides a multiple linkage to target [species](#shared.taxon) and [observation](#rov.observation_type) types with respect to the [annotation protocol](#rov.annotation_protocol).
==== auth_user ====


| Column Name | Type | Not Null | Default | Description |
A Django table for users.
| --- | --- | --- | --- | --- |
| 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) |
| 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). |


##### annotation_protocol <a name="rov.annotation_protocol" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| password
|
|-
| last_login
|
|-
| is_superuser
|
|-
| first_name
|
|-
| last_name
|
|-
| email
|
|-
| is_staff
|
|-
| is_active
|
|-
| date_joined
|
|-
| biigle_username
|
|-
| biigle_api_key
|
|-
| organization
|
|-
| org_type
|
|-
| registration_reason
|
|-
| bio
|
|-
| verification_code
|
|-
| verification_expiry
|
|-
| verification_time
|
|-
| registration_ip
|
|-
| ip_in_region
|
|-
| registration_note
|
|-
| allowed
|
|-
| password_reset_code
|
|-
| password_reset_expiry
|
|-
| registration_location
|
|}


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.
<span id="public.auth_user_groups"></span>


| Column Name | Type | Not Null | Default | Description |
==== auth_user_groups ====
| --- | --- | --- | --- | --- |
| 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. |
| 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. |
| 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". |
| 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. |
| 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. |


##### annotation_protocol_document <a name="rov.annotation_protocol_document" />
A Django table to relate users to groups.


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.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| user_id
|
|-
| group_id
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.auth_user_user_permissions"></span>
| --- | --- | --- | --- | --- |
| 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. |
| 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. |
| 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. |
| title | varchar | False | None | The title of the document. |
| updated_on | timestamp | False | None | The time of update of the record. |
| url | varchar | False | None | An optional URL for the document. If file data are not given, this field is required. |


##### annotation_protocol_taxon <a name="rov.annotation_protocol_taxon" />
==== auth_user_user_permissions ====


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.
A Django for user permissions.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| annotation_protocol_id | int4 | False | None | A link to the [annotation protocol](#rov.annotation_protocol). |
! Comment
| taxon_id | int4 | False | None | A link to the [taxon](#shared.taxon). |
|-
| id
|  
|-
| user_id
|  
|-
| permission_id
|  
|}


##### annotation_software <a name="rov.annotation_software" />
<span id="public.django_admin_log"></span>


The software used for annotation.
==== django_admin_log ====


| Column Name | Type | Not Null | Default | Description |
A Django table for admin logging.
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the annotation software. |
| note | text | False | None | An optional note about the annotation software. |
| short_code | bpchar | False | None | Provides a short code for looking up the entity. |


##### available_setting <a name="rov.available_setting" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| action_time
|
|-
| object_id
|
|-
| object_repr
|
|-
| action_flag
|
|-
| change_message
|
|-
| content_type_id
|
|-
| user_id
|
|}


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.
<span id="public.django_celery_beat_clockedschedule"></span>


| Column Name | Type | Not Null | Default | Description |
==== django_celery_beat_clockedschedule ====
| --- | --- | --- | --- | --- |
| 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 | varchar | False | None | The name of the setting. |
| note | text | False | None | A note about the setting. |
| 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. |


##### biocover <a name="rov.biocover" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| clocked_time
|
|}


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.
<span id="public.django_celery_beat_crontabschedule"></span>


| Column Name | Type | Not Null | Default | Description |
==== django_celery_beat_crontabschedule ====
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the biocover. |
| note | text | False | None | An optional description of the biocover. |
| 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. |


##### comment_event <a name="rov.comment_event" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| minute
|
|-
| hour
|
|-
| day_of_week
|
|-
| day_of_month
|
|-
| month_of_year
|
|-
| timezone
|
|}


Provides a way to record comments rather than using a sparse note field on the [event](#rov.table).
<span id="public.django_celery_beat_intervalschedule"></span>


| Column Name | Type | Not Null | Default | Description |
==== django_celery_beat_intervalschedule ====
| --- | --- | --- | --- | --- |
| event_id | int4 | False | None | A reference to the [parent event](#rov.event). |
| note | text | False | None | A text comment or note. |


##### complexity <a name="rov.complexity" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| every
|
|-
| period
|
|}


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.
<span id="public.django_celery_beat_periodictask"></span>


| Column Name | Type | Not Null | Default | Description |
==== django_celery_beat_periodictask ====
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the complexity type. |
| note | text | False | None | An optional description of the complexity type. |
| 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. |


##### coverage <a name="rov.coverage" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
|
|-
| task
|
|-
| args
|
|-
| kwargs
|
|-
| queue
|
|-
| exchange
|
|-
| routing_key
|
|-
| expires
|
|-
| enabled
|
|-
| last_run_at
|
|-
| total_run_count
|
|-
| date_changed
|
|-
| description
|
|-
| crontab_id
|
|-
| interval_id
|
|-
| solar_id
|
|-
| one_off
|
|-
| start_time
|
|-
| priority
|
|-
| headers
|
|-
| clocked_id
|
|-
| expire_seconds
|
|}


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.
<span id="public.django_celery_beat_periodictasks"></span>


| Column Name | Type | Not Null | Default | Description |
==== django_celery_beat_periodictasks ====
| --- | --- | --- | --- | --- |
| maximum | float4 | False | None | The minimum value in the range. |
| minimum | float4 | False | None | The minimum value in the range. |
| 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. |
| 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. |


##### cruise <a name="rov.cruise" />
:: {| class="wikitable"
! Column
! Comment
|-
| ident
|
|-
| last_update
|
|}


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.
<span id="public.django_celery_beat_solarschedule"></span>


| Column Name | Type | Not Null | Default | Description |
==== django_celery_beat_solarschedule ====
| --- | --- | --- | --- | --- |
| 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. |
| end_time | timestamp | False | None | The end time of the leg. |
| leg | int4 | False | None | Cruise legs are numbered from 1. |
| name | varchar | False | None | A name for this leg of the cruise. |
| note | text | False | None | Notes about the cruise. |
| 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. |


##### cruise_crew <a name="rov.cruise_crew" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| event
|
|-
| latitude
|
|-
| longitude
|
|}


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.
<span id="public.django_celery_results_chordcounter"></span>


| Column Name | Type | Not Null | Default | Description |
==== django_celery_results_chordcounter ====
| --- | --- | --- | --- | --- |
| 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. |


##### cruise_document <a name="rov.cruise_document" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| group_id
|
|-
| sub_tasks
|
|-
| count
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.django_celery_results_groupresult"></span>
| --- | --- | --- | --- | --- |
| 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 |  |


##### cruise_fn_contact <a name="rov.cruise_fn_contact" />
==== django_celery_results_groupresult ====


A table for associating First Nations contacts with a cruise.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| group_id
|
|-
| date_created
|
|-
| date_done
|
|-
| content_type
|
|-
| content_encoding
|
|-
| result
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.django_celery_results_taskresult"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### cruise_library <a name="rov.cruise_library" />
==== django_celery_results_taskresult ====


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.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| task_id
|
|-
| status
|
|-
| content_type
|
|-
| content_encoding
|
|-
| result
|
|-
| date_done
|
|-
| traceback
|
|-
| meta
|
|-
| task_args
|
|-
| task_kwargs
|
|-
| task_name
|
|-
| worker
|
|-
| date_created
|
|-
| periodic_task_name
|
|-
| date_started
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.django_content_type"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### cruise_program <a name="rov.cruise_program" />
==== django_content_type ====


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.
A Django table for content types.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| cruise_id | int4 | False | None | The ID of a [cruise](#rov.cruise). |
! Comment
| program_id | int4 | False | None | The ID of a [program](#rov.program). |
|-
| id
|  
|-
| app_label
|  
|-
| model
|  
|}


##### cruise_role <a name="rov.cruise_role" />
<span id="public.django_migrations"></span>


A lookup table of roles available to members of [cruise leg crews](#rov.cruise_leg_crew).
==== django_migrations ====


| Column Name | Type | Not Null | Default | Description |
Records migrations applied to database.
| --- | --- | --- | --- | --- |
| 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 |  |


##### disturbance <a name="rov.disturbance" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| app
|
|-
| name
|
|-
| applied
|
|}


Provides a nominal level of disturbance for [habitat events](#rov.habitat_event).
<span id="public.django_session"></span>


| Column Name | Type | Not Null | Default | Description |
==== django_session ====
| --- | --- | --- | --- | --- |
| 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. |


##### dive <a name="rov.dive" />
Django session management.


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.
:: {| class="wikitable"
! Column
! Comment
|-
| session_key
|
|-
| session_data
|
|-
| expire_date
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.django_site"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### dive_crew <a name="rov.dive_crew" />
==== django_site ====


Assigns roles to dive crew members. Crew members are selected from the [person](#rov.person).
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| domain
|
|-
| name
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.event_group"></span>
| --- | --- | --- | --- | --- |
| 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). |


##### dive_role <a name="rov.dive_role" />
==== event_group ====


A list of roles available to crew members on a [dive](#rov.dive) via the [dive_crew](#rov.dive_crew) table.
:: {| class="wikitable"
! Column
! Comment
|-
| event_id
|
|-
| group_id
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.knox_authtoken"></span>
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the role. |
| note | text | False | None | An optional description of the role. |
| short_code | varchar | False | None |  |


##### equipment_type <a name="rov.equipment_type" />
==== knox_authtoken ====


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.
:: {| class="wikitable"
! Column
! Comment
|-
| digest
|
|-
| created
|
|-
| user_id
|
|-
| expiry
|
|-
| token_key
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.spatial_ref_sys"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### event <a name="rov.event" />
==== spatial_ref_sys ====


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.
:: {| class="wikitable"
! Column
! Comment
|-
| srid
|
|-
| auth_name
|
|-
| auth_srid
|
|-
| srtext
|
|-
| proj4text
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="public.thumbnail_kvstore"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### event_logger <a name="rov.event_logger" />
==== thumbnail_kvstore ====


This table tracks the [people](#shared.person) who contributed to annotation, which may be composed of a number of separate labels.
:: {| class="wikitable"
! Column
! Comment
|-
| key
|
|-
| value
|
|}


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


##### habitat_event <a name="rov.habitat_event" />
=== Views ===


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.
<span id="public.geography_columns"></span>


| Column Name | Type | Not Null | Default | Description |
==== geography_columns ====
| --- | --- | --- | --- | --- |
| 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. |


##### image_quality <a name="rov.image_quality" />
:: {| class="wikitable"
! Column
! Comment
|-
| f_table_catalog
|
|-
| f_table_schema
|
|-
| f_table_name
|
|-
| f_geography_column
|
|-
| coord_dimension
|
|-
| srid
|
|-
| type
|
|}


Nominal image quality levels, originally used by VideoMiner but applicable to new records.
<span id="public.geometry_columns"></span>


| Column Name | Type | Not Null | Default | Description |
==== geometry_columns ====
| --- | --- | --- | --- | --- |
| name | varchar | False | None | A name for the quality level. |
| note | text | False | None | An optional note. |
| 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. |


##### import_queue_annotator <a name="rov.import_queue_annotator" />
:: {| class="wikitable"
! Column
! Comment
|-
| f_table_catalog
|
|-
| f_table_schema
|
|-
| f_table_name
|
|-
| f_geometry_column
|
|-
| coord_dimension
|
|-
| srid
|
|-
| type
|
|}


Stores the import packages created by annotators.


| Column Name | Type | Not Null | Default | Description |
=== Functions ===
| --- | --- | --- | --- | --- |
| 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. |
| 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. |
| name | varchar | False | None | A unique name for the import queue 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. |
| updated_on | timestamp | False | None | The date of update of the record. |


##### import_queue_annotator_label_map_prefill <a name="rov.import_queue_annotator_label_map_prefill" />
;get_restricted_events
:Return the [[#rov.event|events]] that are either unrestricted, or subject to [[#shared.restriction|restrictions]] for which at least one of the user's [[#public.auth_group|groups]] is permitted.
;restriction_group_set_admin
:When a [[#shared.restriction|restriction]] is inserted, automatically inserts a record into [[#shared.restriction|restriction_group]] group to give admins permission to see the restricted record. Other groups can be added manualy.
;trigger_compile_event_restriction_masks
:Triggers compilation of [[#shared.restriction|restriction]] masks on the [[#rov.event|event]] table when it is updated.
;updated_on_column
:Updates the updated_on column of a relation to the current time on update.


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


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


##### import_queue_pi <a name="rov.import_queue_pi" />
<span id="{schema}"></span>


Stores the import packages created by principal investigators.
== Schema: rov ==


| Column Name | Type | Not Null | Default | Description |
Contains tables related to the imagery annotation (ROV) database.
| --- | --- | --- | --- | --- |
| created_on | timestamp | False | None | The date of creation of the record. |
| cruise_id | int4 | False | None | A reference to the [cruise](#rov.cruise). |
| 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 |
| 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. |
| updated_on | timestamp | False | None | The date of update of the record. |


##### instrument <a name="rov.instrument" />
=== Tables ===


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).
<span id="rov.abundance"></span>


| Column Name | Type | Not Null | Default | Description |
==== abundance ====
| --- | --- | --- | --- | --- |
| attributes | jsonb | False | None | A freeform list of attributes for this instrument. |
| created_on | timestamp | False | None | The date of creation of this record. |
| model_id | int4 | False | None | A reference to the instrument [model](#rov.model). |
| note | text | False | None | An optional note about 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. |
| 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. |
| updated_on | timestamp | False | None | The date of update of this record. |


##### instrument_config <a name="rov.instrument_config" />
Stores a list of abundance labels from the ACFOR scale.


This table records the configuration of an instrument, including settings and its spatial relationship to a parent entity -- another configured vehicle or instrument upon which this instrument is mounted.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| A descriptive label for the abundance level.
|-
| rank
| A rank used to objectively interpret the abundance label as an ordinal rank. It doesn't matter what the values are so long as they increase monotonically and do not overlap.
|-
| source
| A source label to distinguish abundance labels with the same names. TODO: Provisional, pending determination of how abundance codes are handled.
|-
| note
| An optional note about the abundance level.
|-
| short_code
| Contains a short code that can be used to look up an abundance (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.annotation_job"></span>
| --- | --- | --- | --- | --- |
| configuration | jsonb | False | None | Configuration information about the instrument config. |
| created_on | timestamp | False | None | The date of creation of this record. |
| 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. |
| platform_config_id | int4 | False | None |  |
| updated_on | timestamp | False | None | The date of update of this record. |


##### instrument_config_instrument <a name="rov.instrument_config_instrument" />
==== annotation_job ====


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


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| configuration | text | False | None | A JSON object describing the configuration attributes of this instrument. |
! Comment
| 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). |
| id
|  
|-
| name
| A name for the annotation project.
|-
| objective
| A statement of the objectives of the annotation project.
|-
| note
| Operational notes about the annotation project.
|-
| start_date
| The starting date of the project.
|-
| end_date
| The ending date of the project.
|-
| created_on
| The date of creation of the entity.
|-
| updated_on
| The date of last modification of the entity.
|}


##### instrument_setting <a name="rov.instrument_setting" />
<span id="rov.annotation_job_annotation_protocol"></span>


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


| Column Name | Type | Not Null | Default | Description |
Associates the annotation job with one or more [[#rov.annotation_protocol|annotation protocols]], which are used to direct annotation activities.
| --- | --- | --- | --- | --- |
| 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. |


##### measurement <a name="rov.measurement" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| annotation_job_id
| The ID of the [[#rov.annotation_job|annotation job]].
|-
| annotation_protocol_id
| The ID of the [[#rov.annotation_protocol|annotation protocol]].
|}


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.
<span id="rov.annotation_job_crew"></span>


| Column Name | Type | Not Null | Default | Description |
==== annotation_job_crew ====
| --- | --- | --- | --- | --- |
| 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. |
| 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. |
| 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. |


##### measurement_event <a name="rov.measurement_event" />
Associates crew members with an [[#rov.annotation_job|annotation job]] with their respective [[#rov.annotation_job_role|roles]].


A table for storing human-created measurements.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| annotation_job_id
| The ID of the [[#rov.annotation_job|annotation job]].
|-
| person_id
| The ID of the [[#shared.person|crew member]].
|-
| role_id
| The ID of the [[#rov.annotation_job_role|role]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.annotation_job_role"></span>
| --- | --- | --- | --- | --- |
| 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). |
| quantity | float4 | False | None | The measurement value in the [measurement type](#rov.measurement_type) unit. |


##### measurement_type <a name="rov.measurement_type" />
==== annotation_job_role ====


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


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| maximum | float4 | False | None | An optional upper bound on the value of the measurement. Null implies no limit. |
! Comment
| minimum | float4 | False | None | An optional lower bound on the value of the measurement. Null implies no limit. |
|-
| name | varchar | False | None | The type of measurement. E.g., "Density" or "Salinity." |
| id
| note | text | False | None | An optional note about this measurement type. |
|  
| 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. |
| name
| The name of the role.
|-
| note
| A descript of the role.
|}


##### medium <a name="rov.medium" />
<span id="rov.annotation_protocol"></span>


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


| Column Name | Type | Not Null | Default | Description |
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.
| --- | --- | --- | --- | --- |
| 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. |
| 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. |
| 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. |
| 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. |
| 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. |


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


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


| Column Name | Type | Not Null | Default | Description |
==== annotation_protocol_document ====
| --- | --- | --- | --- | --- |
| 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 | varchar | False | None | The name of the format. |
| note | text | False | None | An optional note about the format. |
| 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. |


##### medium_type <a name="rov.medium_type" />
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 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.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| annotation_protocol_id
| A reference to the [[#rov.annotation_protocol|annotation protocol]].
|-
| note
| An optional note about the document.
|-
| title
| The title of the document.
|-
| url
| An optional URL for the document. If file data are not given, this field is required.
|-
| created_on
| The time of creation of the record.
|-
| updated_on
| The time of update of the record.
|-
| file_id
| A reference to the [[#shared.uploaded_file|uploaded file]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.annotation_software"></span>
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the media type. |
| note | text | False | None | An optional note about the media type. |
| short_code | bpchar | False | None | Provides a short code for looking up the entity. |


##### model <a name="rov.model" />
==== annotation_software ====


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).
The software used for annotation.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| attributes | jsonb | False | None | A free-form JSON field for attributes of this model. |
! Comment
| brand_name | varchar | False | None | The brand name. |
|-
| equipment_type_id | int4 | False | None | A reference to the [equipment type](#rov.equipment_type). |
| id
| model_name | varchar | False | None | The model name. |
|  
| note | text | False | None | An optional note about the model. |
|-
| name
| The name of the annotation software.
|-
| note
| An optional note about the annotation software.
|}


##### model_documentation <a name="rov.model_documentation" />
<span id="rov.biigle_label_map"></span>


This table creates an association between a [model](#rov.model) and [documentation in the library](#rov.library).
==== biigle_label_map ====


| Column Name | Type | Not Null | Default | Description |
Contains mappings from Biigle labels to properties that apply to events.
| --- | --- | --- | --- | --- |
| 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). |
| 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. |


##### model_equipment_type <a name="rov.model_equipment_type" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| label_tree_id
| The ID of the Biigle label tree.
|-
| label_id
| The ID of the Biigle label.
|-
| label_hierarchy
| The full hierarchical text of the Biigle label.
|-
| label_text
| The text of the final element of the label.
|-
| properties
| Stores the properties of the observation.
|-
| note
| A textual note or comment.
|-
| created_on
| The time of creation of the record.
|-
| updated_on
| Time of last update of the record.
|}


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.
<span id="rov.biigle_label_map_restriction"></span>


| Column Name | Type | Not Null | Default | Description |
==== biigle_label_map_restriction ====
| --- | --- | --- | --- | --- |
| 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). |


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


Observation categories are used by [annotation protocols](#rov.annotation_protocol).
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| restriction_id
| A link to the [[#shared.restriction|restriction]].
|-
| biigle_label_map_id
| A link to the [[#rov.biigle_label_map|label map]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.biocover"></span>
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the observation category. |
| note | text | False | None | An optional note about the observation category. |
| short_code | varchar | False | None | A short code for referencing the observation category in import documents. |


##### observation_confidence <a name="rov.observation_confidence" />
==== biocover ====


Provides a nominal observation confidence level for [observation events](#rov.observation_event).
A lookup table listing the available biocover types for the [[#rov.event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity. TODO: Should perhaps refer to the [[#taxonomy.taxon|taxon]] table.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| name | varchar | False | None | The textual representation of the confidence level. |
! Comment
| 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. |
| id
| 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. |
|  
|-
| name
| The name of the biocover.
|-
| note
| An optional description of the biocover.
|-
| short_code
| Contains a short code that can be used to look up a biocover (e.g., during import) without relying on the primary key.
|}


##### observation_event <a name="rov.observation_event" />
<span id="rov.complexity"></span>


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


| Column Name | Type | Not Null | Default | Description |
A lookup table listing the available habitat complexity types for the [[#rov.event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
| --- | --- | --- | --- | --- |
| 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. |


##### observation_type <a name="rov.observation_type" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the complexity type.
|-
| note
| An optional description of the complexity type.
|-
| short_code
| Contains a short code that can be used to look up a complexity (e.g., during import) without relying on the primary key.
|}


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.
<span id="rov.coverage"></span>


| Column Name | Type | Not Null | Default | Description |
==== coverage ====
| --- | --- | --- | --- | --- |
| 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. |


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


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.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| A characterization of percent coverage. Presented as a range of percentages.
|-
| minimum
| The minimum value in the range.
|-
| maximum
| The minimum value in the range.
|-
| note
| An optional note about the coverage percentage.
|-
| short_code
| Contains a short code that can be used to look up a coverage (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.cruise"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### orientation_type <a name="rov.orientation_type" />
==== cruise ====


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


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| name | varchar | False | None | The name of the orientation type (e.g., "Quaternion"). |
! Comment
| 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. |
| id
| unit | varchar | False | None | The units used to interpret the elements of the vector. |
|  
|-
| name
| A name for this leg of the cruise.
|-
| objective
| A statement of the operational or scientific objectives of the cruise.
|-
| start_time
| The start time of the leg.
|-
| end_time
| The end time of the leg.
|-
| planned_track
| A multilinestring containing the planned track of the leg. TODO: Not known whether this is necessary.
|-
| note
| Notes about the cruise.
|-
| created_on
| The date of creation of this record.
|-
| updated_on
| The date of update of this record.
|-
| leg
| Cruise legs are numbered from 1.
|-
| summary
| A summary of the cruise, with information about whether the objectives were met and any other pertinent information.
|-
| approved
| If zero, the record is not approved and should not be shown or used. Currently a non-zero value represents approval, but may be expanded to various levels of approval in the future.
|-
| ship_id
| The ID of the [[#rov.platform|ship]] used on this cruise.
|-
| admin_note
| Notes by the database administrator about this entity.
|-
| mark_for_delete
| Marks the entity for asynchronous deletion by the runner.
|}


##### platform <a name="rov.platform" />
<span id="rov.cruise_crew"></span>


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


| Column Name | Type | Not Null | Default | Description |
Associates [[#shared.person|crew members]] with a [[#rov.cruise|cruise leg]] and their [[#rov.cruise_role|roles]]. A crew member can have multiple roles. Note: these roles are distinct from members of [[#rov.program|programs]], such as Chief Scientist. It may be necessary to revisit this structure or the division of roles.
| --- | --- | --- | --- | --- |
| attributes | jsonb | False | None | A freeform list of attributes for this platform. |
| created_on | timestamp | False | None | The date of creation of this record. |
| 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. |
| 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. |
| 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. |
| 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. |


##### platform_config <a name="rov.platform_config" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| cruise_id
|  Reference to the [[#rov.cruise|cruise leg]] to which the member is assigned.
|-
| person_id
| Reference to the [[#shared.person|person]] on the crew.
|-
| cruise_role_id
| Reference to the [[#rov.cruise_role|cruise role]].
|-
| note
| An optional note about the crew member.
|}


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.
<span id="rov.cruise_document"></span>


| Column Name | Type | Not Null | Default | Description |
==== cruise_document ====
| --- | --- | --- | --- | --- |
| configuration | jsonb | False | None | The configuration data as a JSON object. |
| created_on | timestamp | False | None | The date of creation of this record. |
| note | text | False | None | An optional note about the configuration record. |
| platform_id | int4 | False | None | A reference to the [platform](#rov.platform). |
| updated_on | timestamp | False | None | The date of update of this record. |


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


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.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| cruise_id
| The ID of the [[#rov.cruise|cruise]].
|-
| note
| A note about the document.
|-
| title
| The title of the document.
|-
| url
| A URL for the online copy of the document. May be used when no file is available.
|-
| created_on
| The date and time of creation of the entity.
|-
| updated_on
| The date and time of the entity's last update.
|-
| file_id
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.cruise_fn_contact"></span>
| --- | --- | --- | --- | --- |
| 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. |
| 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. |


##### position <a name="rov.position" />
==== cruise_fn_contact ====


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?
A table for associating First Nations contacts with a cruise.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| geom | geography | False | None | The point geometry. |
! Comment
| 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. |
| id
| position_type_id | int4 | False | None | A reference to the [position type](#rov.position_type) of this position. |
|  
| 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. |
| cruise_id
| A reference to the [[#rov.cruise|cruise]].
|-
| contact_name
| The full name of the contact.
|-
| email
| The email address of the contact.
|-
| phone
| The phone number of the contact.
|-
| nation
| The name of the nation or group represented by the contact.
|-
| note
| A note about the contact.
|}


##### position_type <a name="rov.position_type" />
<span id="rov.cruise_import"></span>


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


| Column Name | Type | Not Null | Default | Description |
Stores cruise import tasks in the database. These contain the JSON data description, a status message and complete processing log.
| --- | --- | --- | --- | --- |
| 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. |
| 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." |


##### program <a name="rov.program" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| A unique name for the import job.
|-
| data
| A JSON document containing the cruise import data.
|-
| status
| A status message about processing.
|-
| logs
| A JSON array containing the complete processing log.
|-
| created_on
|
|-
| updated_on
|
|-
| version
|
|-
| task_id
| Stores the task ID for the asychrnonous task (i.e., a Celery task) used to process the import.
|}


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.
<span id="rov.cruise_program"></span>


| Column Name | Type | Not Null | Default | Description |
==== cruise_program ====
| --- | --- | --- | --- | --- |
| 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 | varchar | False | None | The name of the program. |
| note | text | False | None | An optional note about the program. |
| objective | varchar | False | None | The objective or mandate of the program. |
| start_date | date | False | None | The starting date of the program. |
| 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. |


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


A table to associate [programs](#rov.program) with [library](#shared.library) documents.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| cruise_id
| The ID of a [[#rov.cruise|cruise]].
|-
| program_id
| The ID of a [[#rov.program|program]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.cruise_role"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### program_member <a name="rov.program_member" />
==== cruise_role ====


Assigns [user](#rov.person) [roles](#rov.program_role) to a [program](#rov.program).
A lookup table of roles available to members of [[#rov.cruise_crew|cruise leg crews]].


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| person_id | int4 | False | None | A reference to the [person](#rov.person). |
! Comment
| program_id | int4 | False | None | The reference to the [program](#rov.program). |
|-
| role_id | int4 | False | None | A reference to the [program role](#rov.program_role). |
| id
|  
|-
| name
| The name of the role.
|-
| note
| An optional note about the role and its responsibilities.
|-
| short_code
| A short string used to identify the role.
|}


##### program_role <a name="rov.program_role" />
<span id="rov.disturbance"></span>


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


| Column Name | Type | Not Null | Default | Description |
Provides a nominal level of disturbance for [[#rov.event|habitat events]].
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the role. E.g., "Chief Scientist." |
| note | text | False | None | An optional note about the role. |


##### project <a name="rov.project" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The textual representation of the disturbance level.
|-
| note
| A note about the disturbance level.
|-
| short_code
| Contains a short code that can be used to look up a disturbance (e.g., during import) without relying on the primary key.
|}


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.
<span id="rov.dive"></span>


| Column Name | Type | Not Null | Default | Description |
==== dive ====
| --- | --- | --- | --- | --- |
| 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 | varchar | False | None | The name of the project. |
| note | text | False | None | A descriptive note about the project. |
| objective | text | False | None | A note describing the objective of this project. |
| start_date | date | False | None | The creation date of the project. |
| 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. |


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


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


| Column Name | Type | Not Null | Default | Description |
<span id="rov.dive_crew"></span>
| --- | --- | --- | --- | --- |
| cruise_id | int4 | False | None | The [cruise](#rov.cruise). |
| project_id | int4 | False | None | The [project](#rov.project). |


##### project_import_source <a name="rov.project_import_source" />
==== dive_crew ====


Stores information about files from which data for events, measurements and positions have been loaded.
Assigns roles to dive crew members. Crew members are selected from the [[#shared.person|person]].


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| file_id | int4 | False | None | The source [file](#shared.file). |
! Comment
| note | text | False | None | An optional note about the source file. |
|-
| project_id | int4 | False | None | A reference to the project that this file is associated with. |
| id
|  
|-
| dive_id
| The [[#rov.dive|dive]] to which the crew member is assigned.
|-
| person_id
| A reference to the [[#shared.person|person]].
|-
| dive_role_id
| A reference to the [[#rov.dive_role|dive role]].
|-
| note
| An optional note about the crew member.
|}


##### project_member <a name="rov.project_member" />
<span id="rov.dive_role"></span>


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


| Column Name | Type | Not Null | Default | Description |
A list of roles available to crew members on a [[#rov.dive|dive]] via the [[#rov.dive_crew|dive_crew]] table.
| --- | --- | --- | --- | --- |
| 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. |
| role_id | int4 | False | None | The [role](#rov.project_role) assigned to this user (optional). |


##### project_role <a name="rov.project_role" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the role.
|-
| note
| An optional description of the role.
|-
| short_code
| A short string used to identify the role.
|}


This table lists available roles for [users](#rov.project_member) involved in [projects](#rov.project).
<span id="rov.equipment_type"></span>


| Column Name | Type | Not Null | Default | Description |
==== equipment_type ====
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the role. |
| note | text | False | None | An optional note about the role. |


##### protocol <a name="rov.protocol" />
This is a lookup table to provide the names of types of equipment for the [[#rov.model|model]] table, e.g., "Digital Still Camera", "Thermometer," "ROV," etc.


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.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| A name for the equipment type.
|-
| note
| An optional note about the equipment type.
|-
| category
| An enumeration column identifying the equipment as platform, instrument or some other type.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.event"></span>
| --- | --- | --- | --- | --- |
| name | varchar | False | None | A name for the survey protocol. |
| note | text | False | None | An optional note about the protocol. |
| 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. |


##### relief <a name="rov.relief" />
==== event ====


Provides a nominal level of terrain relief for [habitat events](#rov.habitat_event).
The event table, a schemaless table storing all recorded observations and statuses during operations.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| name | varchar | False | None | The textual representation of the relief level. |
! Comment
| note | text | False | None | A note about the relief level. |
|-
| 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. |
| id
|  
|-
| dive_id
| A reference to the dive during which this event occurred.
|-
| annotation_job_id
|
|-
| instrument_config_id
|  
|-
| start_time
| The start time of the event.
|-
| end_time
| The end time of the event. Null, if the event is discrete.
|-
| properties
| A JSON object containing name-value pairs describing the event.
|-
| note
| An optional note about the event. Do not use to store event data.
|-
| created_on
| The time of creation of the event.
|-
| updated_on
| The time of update of the event. Automatically updated by a trigger.
|-
| hidden
| If true, the entity should be hidden from searches and reports. An alternative to deleting entities that may prove useful in the future.
|-
| import_group_id
| A reference to the [[#rov.import_group|import group]], which tracks events which were imported at the same time, from the same file.
|}


##### status_event <a name="rov.status_event" />
<span id="rov.event_group"></span>


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).
==== event_group ====


| Column Name | Type | Not Null | Default | Description |
Links the [[#rov.event|event]] table to the [[#public.auth_group|group]] table to facilitate the [[#shared.restriction|restriction]] mechanism.
| --- | --- | --- | --- | --- |
| 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). |


##### status_type <a name="rov.status_type" />
:: {| class="wikitable"
! Column
! Comment
|-
| event_id
| Links to the [[#rov.event|event]] table.
|-
| group_id
| Links to the [[#public.auth_group|group]] table.
|}


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.
<span id="rov.event_logger"></span>


| Column Name | Type | Not Null | Default | Description |
==== event_logger ====
| --- | --- | --- | --- | --- |
| name | varchar | False | None | The name of the status event. |
| note | text | False | None | An optional description of the status type. |
| short_code | varchar | False | None | A short code for referencing the status type in import documents. |


##### status_type_detail <a name="rov.status_type_detail" />
This table tracks the [[#shared.person|people]] who contributed to annotation, which may be composed of a number of separate labels.


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.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| person_id
| A [[#shared.person|person]] who contributed to the annotation.
|-
| event_id
| The [[#rov.event|event]] that was created from the annotation(s).
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.flow"></span>
| --- | --- | --- | --- | --- |
| 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). |


##### substrate <a name="rov.substrate" />
==== flow ====


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.
Stores categories of current flow for [[#rov.event|habitat]].


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| name | varchar | False | None | The name of the substrate. |
! Comment
| 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. |
| id
|  
|-
| name
| A note about the flow category.
|-
| note
|  
|-
| short_code
| A short code for the flow category.
|}


##### survey_mode <a name="rov.survey_mode" />
<span id="rov.generic_label_map"></span>


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


| Column Name | Type | Not Null | Default | Description |
A table for storing mappings from annotation labels to property sets.
| --- | --- | --- | --- | --- |
| 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. |


##### thickness <a name="rov.thickness" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| label_text
| The text of the label.
|-
| properties
| A dictionary of mapped properties.
|-
| note
| A note about the mapping.
|-
| created_on
| The date of creation.
|-
| updated_on
| The date of last update.
|}


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.
<span id="rov.generic_label_map_restriction"></span>


| Column Name | Type | Not Null | Default | Description |
==== generic_label_map_restriction ====
| --- | --- | --- | --- | --- |
| 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. |


##### transect <a name="rov.transect" />
Links a [[#rov.generic_label_map|generic label mapping]] to a [[#shared.restriction|restriction]].


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"
! Column
! Comment
|-
| id
|
|-
| restriction_id
| A reference to a [[#shared.restriction|restriction]].
|-
| generic_label_map_id
| A reference to a [[#rov.generic_label_map|generic label mapping]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.image_quality"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### weather_observation <a name="rov.weather_observation" />
==== image_quality ====


Surface weather observations can be recorded by any [crew member](#rov.cruise_leg_crew) aboard a ship during a [cruise leg](#rov.cruise_leg).
Nominal image quality levels, originally used by VideoMiner but applicable to new records.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| cruise_crew_id | int4 | False | None | A reference to the [cruise leg crew](#rov.cruise_leg_crew) member who is making the report. |
! Comment
| 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 |
| id
| pressure | float4 | False | None | The air pressure. |
|  
| swell | varchar | False | None | Description of swell. |
|-
| temperature | float4 | False | None | The air temperature. |
| name
| time | timestamp | False | None | An optional note about the weather. |
| A name for the quality level.
| wind_direction | float4 | False | None | The wind direction. |
|-
| wind_speed | float4 | False | None | The wind speed. |
| rank
| An ordinal rank (zero is high) for the quality level.
|-
| note
| An optional note.
|-
| short_code
| Contains a short code that can be used to look up an image quality (e.g., during import) without relying on the primary key.
|}


##### cruise_track <a name="rov.cruise_track" />
<span id="rov.import_group"></span>


Constructs a geometry for each [cruise](#rov.cruise) which describes the path of the ship.
==== import_group ====


| Column Name | Type | Not Null | Default | Description |
Stores information about a group of [[#rov.measurement|measurements]], [[#rov.position|positions]] or [[#rov.event|events]] so they can be distinguished by when or from what file they were imported. This provides the ability to delete a single stream of data at a finer resolution that just the [[#rov.instrument_config|instrument config]], [[#rov.platform_config|platform config]], [[#rov.dive|dive]], etc. The initial entries in the table are created retroactively, and contain undifferentiated records based on the instrument config and measurement type (measurements); the instrument config (positions) or the dive and instrument config (events).
| --- | --- | --- | --- | --- |
| 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). |


##### dive_track <a name="rov.dive_track" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| A name for the import or the name of the file from which the data were imported.
|-
| note
|
|-
| created_on
| The date and time that the import was initiated.
|-
| source_file
|
|}


Constructs a geometry for each [dive](#rov.dive) which describes the path of the submersible.
<span id="rov.import_queue_annotator"></span>


| Column Name | Type | Not Null | Default | Description |
==== import_queue_annotator ====
| --- | --- | --- | --- | --- |
| 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). |


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


Creates a relation between an [event](#rov.event) and the [positions](#rov.position) nearest the start and end times of the event.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| user_id
| A reference to the [[#shared.mseauser|MSEA user]] that created the record.
|-
| note
| An optional note about the import package.
|-
| created_on
| The date of creation of the record.
|-
| updated_on
| The date of update of the record.
|-
| name
| A unique name for the import queue record.
|-
| status
| A short description of the processing status of the job.
|-
| cruise_name
| The name of the [[#rov.cruise|cruise]] to which this record is linked. A lookup is not used because the cruise record may not have been created yet.
|-
| data
| Stores the JSON representation of the import job.
|-
| hidden
|
|-
| objective
|
|-
| start_date
|
|-
| end_date
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.import_queue_annotator_label_map_prefill"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### measurement_position <a name="rov.measurement_position" />
==== import_queue_annotator_label_map_prefill ====


Creates a relation between a [measurement](#rov.measurement) and the temporally-nearest [position](#rov.position).
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"
| --- | --- | --- | --- | --- |
! Column
| measurement_id | int4 | False | None | The link to the [measurement](#rov.measurement). |
! Comment
| position_id | int4 | False | None | The link to the [position](#rov.position). |
|-
| id
|  
|-
| tags
| The list of tags.
|-
| properties
| The the tag data.
|-
| created_on
| The date and time of creation of the entity.
|-
| updated_on
| The date and time of the entity's last update.
|-
| name
| The text of the label.
|-
| label_tree_name
| The label tree name. If given identifies the label uniquely with the tree name.
|-
| event_type
|
|}


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


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


| Column Name | Type | Not Null | Default | Description |
Stores the import packages created by principal investigators.
| --- | --- | --- | --- | --- |
| 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. |


##### comment_event_position <a name="rov.comment_event_position" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| user_id
| A reference to the [[#shared.mseauser|MSEA user]] that created the record.
|-
| name
| A name of the import job
|-
| note
| An optional note about the import package.
|-
| status
| A short description of the processing status of the job.
|-
| created_on
| The date of creation of the record.
|-
| updated_on
| The date of update of the record.
|-
| cruise_id
| A reference to the [[#rov.cruise|cruise]].
|-
| hidden
|
|}


Creates a relation between an [comment event](#rov.comment_event) and the [positions](#rov.position) nearest the start and end times of the event.
<span id="rov.instrument"></span>


| Column Name | Type | Not Null | Default | Description |
==== instrument ====
| --- | --- | --- | --- | --- |
| 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. |


##### habitat_event_position <a name="rov.habitat_event_position" />
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]].


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"
! Column
! Comment
|-
| id
|
|-
| model_id
| A reference to the instrument [[#rov.model|model]].
|-
| serial_number
| The serial number of the instrument. If a serial number is not available, some unique identifier can be substituted. No two instruments of the same model may have the same serial number.
|-
| retired
| If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active.
|-
| attributes
| A freeform list of attributes for this instrument.
|-
| note
| An optional note about this instrument.
|-
| created_on
| The date of creation of this record.
|-
| updated_on
| The date of update of this record.
|-
| organisation_id
| A reference to the organisation that owns and operates the instrument.
|-
| name
| A name for the instrument to distinguish it from others of the same model.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.instrument_config"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### observation_event_position <a name="rov.observation_event_position" />
==== instrument_config ====


Creates a relation between an [observation event](#rov.observation_event) and the [positions](#rov.position) nearest the start and end times of the event.
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"
| --- | --- | --- | --- | --- |
! Column
| 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. |
! Comment
| 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. |
| id
|  
|-
| configuration
| Configuration information about the instrument config.
|-
| note
| An optional note about this configuration.
|-
| created_on
| The date of creation of this record.
|-
| updated_on
| The date of update of this record.
|-
| platform_config_id
| The ID of the [[#rov.platform|platform]] upon which the instrument is used.
|-
| instrument_id
| Reference to the [[#rov.instrument|instrument]] targeted by the configuration.
|-
| mark_for_delete
| Marks the entity for asynchronous deletion by the runner.
|}


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


Creates a relation between an [status event](#rov.status_event) and the [positions](#rov.position) nearest the start and end times of the event.
==== measurement ====


| Column Name | Type | Not Null | Default | Description |
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.
| --- | --- | --- | --- | --- |
| 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. |


#### ndst
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| measurement_type_id
| A reference to the [[#rov.measurement_type|type]] of this measurement.
|-
| timestamp
| The time that the measurement was recorded.
|-
| quantity
| The scalar quantity or magnitude of the measurement.
|-
| signal_quality
| A quality of the measurement as reported by the instrument. TODO: Requires clarification.
|-
| is_modelled
| A flag to indicate whether the value is derived from measurements by some modelling process.
|-
| instrument_config_id
| The [[#rov.instrument_config|configured instrument]] used to generate this item.
|-
| import_group_id
| A reference to the [[#rov.import_group|import group]], which tracks measurements which were imported at the same time, from the same file.
|}


##### cruise <a name="ndst.cruise" />
<span id="rov.measurement_type"></span>


| Column Name | Type | Not Null | Default | Description |
==== measurement_type ====
| --- | --- | --- | --- | --- |
| 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 |  |


##### diveconfig <a name="ndst.diveconfig" />
This is a lookup table of types of measurement types for the [[#rov.measurement|measurement]] table. This is fairly open-ended and can represent something like salinity with a specific unit, be it the SI unit or a discipline-specific unit. It is provided to allow users to easily select units for a measurement category when importing data.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| active | bool | False | None |  |
! Comment
| name | text | False | None |  |
|-
| note | text | False | None |  |
| id
| row_id | text | False | None |  |
|  
| ship_config | text | False | None |  |
|-
| ship_instrument_configs | text | False | None |  |
| name
| sub_config | text | False | None |  |
| The type of measurement. E.g., "Density" or "Salinity."
| sub_instrument_configs | text | False | None |  |
|-
| unit
| The unit. SI units are preferred but not required. The unit selection should probably depend on field-specific idiomatic or cultural preferences.
|-
| minimum
| An optional lower bound on the value of the measurement. Null implies no limit.
|-
| maximum
| An optional upper bound on the value of the measurement. Null implies no limit.
|-
| note
| An optional note about this measurement type.
|-
| short_code
| Contains a short code that can be used to look up a measurement type (e.g., during import) without relying on the primary key.
|}


##### dives <a name="ndst.dives" />
<span id="rov.medium_format"></span>


| Column Name | Type | Not Null | Default | Description |
==== medium_format ====
| --- | --- | --- | --- | --- |
| 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 |  |


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


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| active | bool | False | None |  |
! Comment
| configuration | text | False | None |  |
|-
| name | text | False | None | |
| id
| note | text | False | None |  |
|  
| row_id | text | False | None |  |
|-
| short_code | text | False | None |  |
| medium_type_id
| type | text | False | None |  |
| A reference to the [[#rov.medium_type|medium type]] (e.g., video or photo).
|-
| name
| The name of the format.
|-
| extensions
| A list of file extensions that correspond to this medium type. For example, the JPEG image type may have extensions "jpg" or "jpeg" in any case. This list will help applications guess the correct format of a file if it isn't known. Note that more than one media type can have the same extension, so this feature doesn't provide a guaranteed one-to-one mapping. Use it only as a guide.
|-
| note
| An optional note about the format.
|-
| short_code
| Contains a short code that can be used to look up a medium format (e.g., during import) without relying on the primary key.
|}


##### equipment <a name="ndst.equipment" />
<span id="rov.medium_type"></span>


| Column Name | Type | Not Null | Default | Description |
==== medium_type ====
| --- | --- | --- | --- | --- |
| 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 |  |


##### people <a name="ndst.people" />
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"
| --- | --- | --- | --- | --- |
! Column
| active | bool | False | None |  |
! Comment
| email | text | False | None |  |
|-
| first_name | text | False | None |  |
| id
| initials | text | False | None |  |
|  
| last_name | text | False | None |  |
|-
| person_id | int4 | False | None |  |
| name
| row_id | text | False | None |  |
| The name of the media type.
|-
| note
| An optional note about the media type.
|-
| short_code
| Provides a short code for looking up the entity.
|}


##### transects <a name="ndst.transects" />
<span id="rov.model"></span>


| Column Name | Type | Not Null | Default | Description |
==== model ====
| --- | --- | --- | --- | --- |
| 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 |  |


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


### Protected Areas
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| brand_name
| The brand name.
|-
| model_name
| The model name.
|-
| attributes
| A free-form JSON field for attributes of this model.
|-
| note
| An optional note about the model.
|-
| equipment_type_id
| A reference to the [[#rov.equipment_type|equipment type]].
|}


These tables relate to protected areas.
<span id="rov.observation_confidence"></span>


#### pa
==== observation_confidence ====


##### mpa <a name="pa.mpa" />
Provides a nominal observation confidence level for [[#rov.event|observation events]].


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| aichi_t11 | varchar | False | None |  |
! Comment
| biome | varchar | False | None |  |
|-
| comments | varchar | False | None |  |
| id
| delisdate | int4 | False | None |  |
|  
| geom | geography | False | None |  |
|-
| geometry | geometry | False | None |  |
| name
| gov_type | varchar | False | None |  |
| The textual representation of the confidence level.
| iucn_cat | varchar | False | None |  |
|-
| jur_id | varchar | False | None |  |
| rank
| legisl_e | varchar | False | None |  |
| This field is a way of ranking confidence levels so that an ordering can be established.
| legisl_f | varchar | False | None |  |
|-
| loc_e | varchar | False | None |  |
| note
| loc_f | varchar | False | None |  |
| A note about the confidence level.
| mgmt_e | varchar | False | None |  |
|-
| mgmt_f | varchar | False | None |  |
| short_code
| name_e | 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.
| 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 |  |


##### mpa_data_object <a name="pa.mpa_data_object" />
<span id="rov.orientation"></span>


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


| Column Name | Type | Not Null | Default | Description |
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.
| --- | --- | --- | --- | --- |
| 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. |


##### mpa_data_object_file <a name="pa.mpa_data_object_file" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| orientation_type_id
| A reference to the [[#rov.orientation_type|orientation type]] of this orientation.
|-
| timestamp
| The time the position was recorded.
|-
| orientation
| The orientation vector.
|-
| signal_quality
| The signal quality of the position as reported by the instrument. TODO: Requires clarification.
|-
| is_modelled
| A flag to indicate whether the value is derived from measurements by some modelling process.
|-
| instrument_config_id
| The [[#rov.instrument_config|configured instrument]] used to generate this item.
|}


Gives the ability for more than one [data object](#mpa.data_object) to own a [file](#shared.file) and vice versa.
<span id="rov.orientation_type"></span>


| Column Name | Type | Not Null | Default | Description |
==== orientation_type ====
| --- | --- | --- | --- | --- |
| 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). |


##### protected_area <a name="pa.protected_area" />
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.


A unified table for protected areas.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the orientation type (e.g., "Quaternion").
|-
| unit
| The units used to interpret the elements of the vector.
|-
| note
| An optional note about the orientation type.
|-
| short_code
| Contains a short code that can be used to look up an orientation type (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.platform"></span>
| --- | --- | --- | --- | --- |
| 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. |


##### protected_area_data_object <a name="pa.protected_area_data_object" />
==== platform ====


A data object related to an [RCA](#rca.rca). This is the abstract, or top-level object, which may contain one or more physical objects (files) or documents.
This table maintains the inventory of vehicles, that is, ships and ROVs.


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


##### protected_area_data_object_file <a name="pa.protected_area_data_object_file" />
<span id="rov.platform_config"></span>


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


| Column Name | Type | Not Null | Default | Description |
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.
| --- | --- | --- | --- | --- |
| 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). |


##### rca <a name="pa.rca" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| platform_id
| A reference to the [[#rov.platform|platform]].
|-
| configuration
| The configuration data as a JSON object.
|-
| note
| An optional note about the configuration record.
|-
| created_on
| The date of creation of this record.
|-
| updated_on
| The date of update of this record.
|-
| mark_for_delete
| Marks the entity for asynchronous deletion by the runner.
|}


Stores basic information about RCAs along with a boundary geometry.
<span id="rov.position"></span>


| Column Name | Type | Not Null | Default | Description |
==== position ====
| --- | --- | --- | --- | --- |
| 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
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?


These tables are owned by the Mediawiki installation.
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| position_type_id
| A reference to the [[#rov.position_type|position type]] of this position.
|-
| timestamp
| The time the position was recorded.
|-
| signal_quality
| The signal quality of the position as reported by the instrument. TODO: Requires clarification.
|-
| geom
| The point geometry.
|-
| is_modelled
| A flag to indicate whether the value is derived from measurements by some modelling process.
|-
| instrument_config_id
| The [[#rov.instrument_config|configured instrument]] used to generate this item.
|-
| import_group_id
| A reference to the [[#rov.import_group|import group]], which tracks positions which were imported at the same time, from the same file.
|}


#### wiki
<span id="rov.position_type"></span>


##### actor <a name="wiki.actor" />
==== position_type ====


| Column Name | Type | Not Null | Default | Description |
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.
| --- | --- | --- | --- | --- |
| actor_id | int8 | False | None |  |
| actor_name | text | False | None |  |
| actor_user | int4 | False | None |  |


##### archive <a name="wiki.archive" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the position type. E.g., "Geographic" or "Yaw, Pitch, Roll."
|-
| unit
| The unit. Linear or angular. E.g., "m" or "radians."
|-
| note
| An optional note about this position type.
|-
| short_code
| Contains a short code that can be used to look up a position type (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.program"></span>
| --- | --- | --- | --- | --- |
| 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 |  |


##### bot_passwords <a name="wiki.bot_passwords" />
==== program ====


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


##### category <a name="wiki.category" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the program.
|-
| objective
| The objective or mandate of the program.
|-
| start_date
| The starting date of the program.
|-
| end_date
| The optional end date of the program.
|-
| note
| An optional note about the program.
|-
| created_on
| The date of creation of this item.
|-
| updated_on
| The date of update of this record.
|-
| summary
| A summary of the [[#rov.program|program]]; whether objectives were met, problems encountered, etc.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.program_member"></span>
| --- | --- | --- | --- | --- |
| 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 |  |


##### categorylinks <a name="wiki.categorylinks" />
==== program_member ====


| Column Name | Type | Not Null | Default | Description |
Assigns [[#shared.person|user]] [[#rov.program_role|roles]] to a [[#rov.program|program]].
| --- | --- | --- | --- | --- |
| 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 |  |


##### change_tag <a name="wiki.change_tag" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| program_id
| The reference to the [[#rov.program|program]].
|-
| person_id
| A reference to the [[#shared.person|person]].
|-
| role_id
| A reference to the [[#rov.program_role|program role]].
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.program_role"></span>
| --- | --- | --- | --- | --- |
| 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 |  |


##### change_tag_def <a name="wiki.change_tag_def" />
==== program_role ====


| Column Name | Type | Not Null | Default | Description |
Represents the roles a [[#shared.person|person]] might perform in respect to a [[#rov.program|program]]. A person can be assigned multiple roles within a single program, and multiple people can work on a program with the same role.
| --- | --- | --- | --- | --- |
| ctd_count | int8 | False | None |  |
| ctd_id | int4 | False | None |  |
| ctd_name | text | False | None |  |
| ctd_user_defined | int2 | False | None |  |


##### comment <a name="wiki.comment" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the role. E.g., "Chief Scientist."
|-
| note
| An optional note about the role.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.protocol"></span>
| --- | --- | --- | --- | --- |
| comment_data | text | False | None |  |
| comment_hash | int4 | False | None |  |
| comment_id | int8 | False | None |  |
| comment_text | text | False | None |  |


##### content <a name="wiki.content" />
==== protocol ====


| Column Name | Type | Not Null | Default | Description |
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.
| --- | --- | --- | --- | --- |
| 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 |  |


##### content_models <a name="wiki.content_models" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| A name for the survey protocol.
|-
| note
| An optional note about the protocol.
|-
| short_code
| Contains a short code that can be used to look up a survey protocol (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.relief"></span>
| --- | --- | --- | --- | --- |
| model_id | int4 | False | None |  |
| model_name | text | False | None |  |


##### externallinks <a name="wiki.externallinks" />
==== relief ====


| Column Name | Type | Not Null | Default | Description |
Provides a nominal level of terrain relief for [[#rov.event|habitat events]].
| --- | --- | --- | --- | --- |
| 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 |  |


##### filearchive <a name="wiki.filearchive" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The textual representation of the relief level.
|-
| note
| A note about the relief level.
|-
| short_code
| Contains a short code that can be used to look up a relief (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.signup_area"></span>
| --- | --- | --- | --- | --- |
| 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 |  |


##### image <a name="wiki.image" />
==== signup_area ====


| Column Name | Type | Not Null | Default | Description |
Stores the region within which sign-ups are permitted, generally North America.
| --- | --- | --- | --- | --- |
| 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 |  |


##### imagelinks <a name="wiki.imagelinks" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the sign-up region.
|-
| geom
| The geometry of the sign-up region.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.status_type"></span>
| --- | --- | --- | --- | --- |
| il_from | int4 | False | None |  |
| il_from_namespace | int4 | False | None |  |
| il_to | text | False | None |  |


##### interwiki <a name="wiki.interwiki" />
==== status_type ====


| Column Name | Type | Not Null | Default | Description |
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.
| --- | --- | --- | --- | --- |
| 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 |  |


##### ip_changes <a name="wiki.ip_changes" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the status event.
|-
| note
| An optional description of the status type.
|-
| short_code
| A short code for referencing the status type in import documents.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.status_type_detail"></span>
| --- | --- | --- | --- | --- |
| ipc_hex | text | False | None |  |
| ipc_rev_id | int4 | False | None |  |
| ipc_rev_timestamp | timestamptz | False | None |  |


##### ipblocks <a name="wiki.ipblocks" />
==== status_type_detail ====


| Column Name | Type | Not Null | Default | Description |
This table associates a [[#rov.status_type|status type]] with a [[#rov.event|status event]]. The point of this indirection is to allow the addition of detail relative to the status type. For example, there are multiple reasons why an ROV might be "off transect", including that the vehicle has experienced a failure, or the pilot is investigating some interesting object with no research value. The [[#rov.status_type|status type]] value is the discriminator for the event, but the detail adds context the doesn't interfere with it.
| --- | --- | --- | --- | --- |
| 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 |  |


##### ipblocks_restrictions <a name="wiki.ipblocks_restrictions" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| status_type_id
| A reference to the [[#rov.status_type|status type]].
|-
| name
| The status type detail. This field distinguishes different uses for [[#rov.status_type|status types]]. For example, there can be more than one reason to record an "Off Transect" event.
|-
| note
| Optional extended description of detail.
|-
| short_code
| Contains a short code that can be used to look up a status type detail (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.substrate"></span>
| --- | --- | --- | --- | --- |
| ir_ipb_id | int4 | False | None |  |
| ir_type | int2 | False | None |  |
| ir_value | int4 | False | None |  |


##### iwlinks <a name="wiki.iwlinks" />
==== substrate ====


| Column Name | Type | Not Null | Default | Description |
A lookup table listing the available substrate types for the [[#rov.event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
| --- | --- | --- | --- | --- |
| iwl_from | int4 | False | None |  |
| iwl_prefix | text | False | None |  |
| iwl_title | text | False | None |  |


##### job <a name="wiki.job" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the substrate.
|-
| note
| An optional description of the substrate.
|-
| short_code
| Contains a short code that can be used to look up a substrate (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.survey_mode"></span>
| --- | --- | --- | --- | --- |
| 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 |  |


##### l10n_cache <a name="wiki.l10n_cache" />
==== survey_mode ====


| Column Name | Type | Not Null | Default | Description |
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.
| --- | --- | --- | --- | --- |
| lc_key | varchar | False | None |  |
| lc_lang | text | False | None |  |
| lc_value | text | False | None |  |


##### langlinks <a name="wiki.langlinks" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| The name of the survey mode.
|-
| note
| An optional note about the survey mode.
|-
| short_code
| Contains a short code that can be used to look up a survey mode (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.thickness"></span>
| --- | --- | --- | --- | --- |
| ll_from | int4 | False | None |  |
| ll_lang | text | False | None |  |
| ll_title | text | False | None |  |


##### linktarget <a name="wiki.linktarget" />
==== thickness ====


| Column Name | Type | Not Null | Default | Description |
A lookup table listing the available substrate thicknesses for the [[#rov.event|habitat_event]] table. TODO: This table may be altered to provide a hierarchical list of types with increasing specificity.
| --- | --- | --- | --- | --- |
| lt_id | int8 | False | None |  |
| lt_namespace | int4 | False | None |  |
| lt_title | text | False | None |  |


##### log_search <a name="wiki.log_search" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| name
| A characterization of biocover thickness.
|-
| minimum
| The minimum value in the range.
|-
| maximum
| The maximum value in the range.
|-
| note
| An optional note about the biocover thickness.
|-
| short_code
| Contains a short code that can be used to look up a thickness (e.g., during import) without relying on the primary key.
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.transect"></span>
| --- | --- | --- | --- | --- |
| ls_field | text | False | None |  |
| ls_log_id | int4 | False | None |  |
| ls_value | varchar | False | None |  |


##### logging <a name="wiki.logging" />
==== transect ====


| Column Name | Type | Not Null | Default | Description |
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]].
| --- | --- | --- | --- | --- |
| 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 |  |


##### module_deps <a name="wiki.module_deps" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| dive_id
| A reference to the [[#rov.dive|dive]] during which this transect occurred.
|-
| name
| The name of the transect.
|-
| objective
| A statement of the practical or research objectives for this true.
|-
| start_time
| The start time of the transect.
|-
| end_time
| The end time of the transect.
|-
| note
| An optional note about the transect.
|-
| attributes
| A JSON column used for recording structured attributes that do not fit with the regular table structure.
|-
| summary
| A summary of the [[#rov.transect|transect]]; whether objectives were met, problems encountered, etc.
|-
| admin_note
|
|}


| Column Name | Type | Not Null | Default | Description |
<span id="rov.weather_observation"></span>
| --- | --- | --- | --- | --- |
| md_deps | text | False | None |  |
| md_module | text | False | None |  |
| md_skin | text | False | None |  |


##### objectcache <a name="wiki.objectcache" />
==== weather_observation ====


| Column Name | Type | Not Null | Default | Description |
Surface weather observations can be recorded by any [[#rov.cruise_crew|crew member]] aboard a ship during a [[#rov.cruise|cruise leg]].
| --- | --- | --- | --- | --- |
| exptime | timestamptz | False | None |  |
| flags | int4 | False | None |  |
| keyname | text | False | None |  |
| modtoken | varchar | False | None |  |
| value | text | False | None |  |


##### oldimage <a name="wiki.oldimage" />
:: {| class="wikitable"
! Column
! Comment
|-
| id
|
|-
| cruise_crew_id
| A reference to the [[#rov.cruise_crew|cruise leg crew]] member who is making the report.
|-
| temperature
| The air temperature.
|-
| pressure
| The air pressure.
|-
| wind_speed
| The wind speed.
|-
| wind_direction
| The wind direction.
|-
| swell
| Description of swell.
|-
| time
| An optional note about the weather.
|-
| note
| An optional note about the observation
|-
| cruise_id
| A link to the [[#rov.cruise|cruise]] during which this record was recorded.
|}


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


##### page <a name="wiki.page" />
<span id="{schema}"></span>


| Column Name | Type | Not Null | Default | Description |
== Schema: shared ==
| --- | --- | --- | --- | --- |
| 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 |  |


##### page_props <a name="wiki.page_props" />
Contains tables that support all applications on the server, such as the "person" table, which provides personnel lists.


| Column Name | Type | Not Null | Default | Description |
=== Tables ===
| --- | --- | --- | --- | --- |
| pp_page | int4 | False | None |  |
| pp_propname | text | False | None |  |
| pp_sortkey | float8 | False | None |  |
| pp_value | text | False | None |  |


##### page_restrictions <a name="wiki.page_restrictions" />
<span id="shared.db_version"></span>


| Column Name | Type | Not Null | Default | Description |
==== db_version ====
| --- | --- | --- | --- | --- |
| 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 |  |


##### pagelinks <a name="wiki.pagelinks" />
Stores the current database version so that upgrade scripts can perform migrations appropriately.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| pl_from | int4 | False | None |  |
! Comment
| pl_from_namespace | int4 | False | None |  |
|-
| pl_namespace | int4 | False | None |  |
| id
| pl_title | text | False | None |  |
|  
|-
| version_major
| The major version.
|-
| version_minor
| The minor version number.
|-
| updated_on
| The time the upgrade was performed.
|-
| revision
| The revision number.
|}


##### protected_titles <a name="wiki.protected_titles" />
<span id="shared.file"></span>


| Column Name | Type | Not Null | Default | Description |
==== file ====
| --- | --- | --- | --- | --- |
| 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 |  |


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


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


##### querycache_info <a name="wiki.querycache_info" />
<span id="shared.file_type"></span>


| Column Name | Type | Not Null | Default | Description |
==== file_type ====
| --- | --- | --- | --- | --- |
| qci_timestamp | timestamptz | False | None |  |
| qci_type | text | False | None |  |


##### querycachetwo <a name="wiki.querycachetwo" />
A list of file types.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| qcc_namespace | int4 | False | None |  |
! Comment
| qcc_namespacetwo | int4 | False | None |  |
|-
| qcc_title | text | False | None |  |
| id
| qcc_titletwo | text | False | None |  |
|  
| qcc_type | text | False | None |  |
|-
| qcc_value | int4 | False | None |  |
| name
| The name of the file type.
|-
| short_code
| A short code for referencing the file type in import documents.
|}


##### recentchanges <a name="wiki.recentchanges" />
<span id="shared.mseauser"></span>


| Column Name | Type | Not Null | Default | Description |
==== mseauser ====
| --- | --- | --- | --- | --- |
| 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 |  |


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


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| rd_fragment | text | False | None | |
! Comment
| rd_from | int4 | False | None | |
|-
| rd_interwiki | varchar | False | None | |
| id
| rd_namespace | int4 | False | None | |
|  
| rd_title | text | False | None |  |
|-
| user_id
| A reference to the [[#public.auth_user|Django user]].
|-
| biigle_username
| The Biigle username.
|-
| biigle_api_key
| The Biigle API key.
|-
| pg_role
| The name of the PostgreSQL role that the user will use to log in directly to the database.
|-
| organization
| The organization with which a user is affiliated.
|-
| org_type
| The the type of organization with which the user is affiliated.
|-
| registration_reason
| A short note about why the user registered.
|-
| bio
| Biographical information about the user.
|-
| verification_code
| An auto-generated string used to identify the user for verification purposes.
|-
| verification_expiry
| The time of expiration of the verification code.
|-
| verification_time
| The date and time at which the user was verified.
|-
| registration_ip
| The IP used by the user to register.
|-
| ip_in_region
| Set to true if the user's IP is within the signup region. False positives and negatives are possible.
|-
| registration_note
| Administrator notes about the user's registration status.
|-
| allowed
| If true, the user is allowed to sign in. This can be set to false during sign up (e.g., by failing the IP check) or by an admin.
|}


##### revision <a name="wiki.revision" />
<span id="shared.organisation"></span>


| Column Name | Type | Not Null | Default | Description |
==== organisation ====
| --- | --- | --- | --- | --- |
| 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 |  |


##### revision_comment_temp <a name="wiki.revision_comment_temp" />
Convenient storage for organisations involved in MSEA activities.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| revcomment_comment_id | int8 | False | None |  |
! Comment
| revcomment_rev | int4 | False | None |  |
|-
| id
|  
|-
| name
| The full name of the organisation.
|-
| country
| The code for the country where the organisation is based (e.g., "CA" for Canada).
|-
| note
| An optional note about the organisation.
|}


##### searchindex <a name="wiki.searchindex" />
<span id="shared.person"></span>


| Column Name | Type | Not Null | Default | Description |
==== person ====
| --- | --- | --- | --- | --- |
| si_page | int4 | False | None |  |
| si_text | text | False | None |  |
| si_title | varchar | False | None |  |


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


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| si_key | text | False | None | |
! Comment
| si_site | int4 | False | None | |
|-
| si_type | text | False | None |  |
| id
|  
|-
| biigle_user_id
| The Biigle database ID of a user. The UUID should be used instead.
|-
| first_name
| First name.
|-
| last_name
| Last name.
|-
| email
| Email address.
|-
| photo
| A photo of the person.
|-
| bio
| A brief biography of the person.
|-
| biigle_uuid
| The Biigle UUID is used to identify the user in Biigle apps.
|-
| affiliation
| The organization with which this user is currently affiliated.
|}


##### site_stats <a name="wiki.site_stats" />
<span id="shared.restriction"></span>


| Column Name | Type | Not Null | Default | Description |
==== restriction ====
| --- | --- | --- | --- | --- |
| 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 |  |


##### sites <a name="wiki.sites" />
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.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| site_config | text | False | None |  |
! Comment
| site_data | text | False | None |  |
|-
| site_domain | varchar | False | None |  |
| id
| site_forward | int2 | False | None |  |
|  
| site_global_key | text | False | None |  |
|-
| site_group | text | False | None |  |
| name
| site_id | int4 | False | None |  |
| The name of the restriction.
| site_language | text | False | None |  |
|-
| site_protocol | text | False | None |  |
| key
| site_source | text | False | None |  |
| The top-level property name or key.
| site_type | text | False | None |  |
|-
| pattern
| A pattern matching the property value using the SQL ILIKE operator. An exact (case-insensitive) match is a bare string, while appending % at any location is a wildcard match. For example, '%term' matches 'exterm' but not 'exterminate'.
|-
| note
| An optional note about the restriction.
|-
| created_on
| The date of creation of the restriction.
|-
| updated_on
| The date of last update of the restriction.
|}


##### slot_roles <a name="wiki.slot_roles" />
<span id="shared.restriction_group"></span>


| Column Name | Type | Not Null | Default | Description |
==== restriction_group ====
| --- | --- | --- | --- | --- |
| role_id | int4 | False | None |  |
| role_name | text | False | None |  |


##### slots <a name="wiki.slots" />
Links the restriction to a group. Members of linked groups are able to view the restricted items.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| slot_content_id | int8 | False | None |  |
! Comment
| slot_origin | int8 | False | None |  |
|-
| slot_revision_id | int8 | False | None |  |
| id
| slot_role_id | int2 | False | None |  |
|  
|-
| restriction_id
| The ID of the [[#shared.restriction|restriction]].
|-
| group_id
| The ID of the Django authentication group.
|}


##### templatelinks <a name="wiki.templatelinks" />
<span id="shared.site"></span>


| Column Name | Type | Not Null | Default | Description |
==== site ====
| --- | --- | --- | --- | --- |
| tl_from | int4 | False | None |  |
| tl_from_namespace | int4 | False | None |  |
| tl_target_id | int8 | False | None |  |


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


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| old_flags | text | False | None |  |
! Comment
| old_id | int4 | False | None |  |
|-
| old_text | text | False | None |  |
| id
| textvector | tsvector | False | None |  |
|  
|-
| spatial_library_id
| A reference to the [[#shared.spatial_library|spatial library]] entry.
|-
| name
| A name for the site.
|-
| note
| An optional note about the site.
|}


##### updatelog <a name="wiki.updatelog" />
<span id="shared.spatial_library"></span>


| Column Name | Type | Not Null | Default | Description |
==== spatial_library ====
| --- | --- | --- | --- | --- |
| ul_key | varchar | False | None |  |
| ul_value | text | False | None |  |


##### uploadstash <a name="wiki.uploadstash" />
Maintains a library of spatial data.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| us_chunk_inx | int4 | False | None | |
! Comment
| us_id | int4 | False | None |  |
|-
| us_image_bits | int2 | False | None |  |
| id
| us_image_height | int4 | False | None |  |
|  
| us_image_width | int4 | False | None |  |
|-
| us_key | varchar | False | None |  |
| file_id
| us_media_type | us_media_type_enum | False | None |  |
| A reference to a related [[#shared.file|file]].
| us_mime | varchar | False | None |  |
|-
| us_orig_path | varchar | False | None |  |
| name
| us_path | varchar | False | None |  |
| A name for the entry.
| us_props | text | False | None |  |
|-
| us_sha1 | varchar | False | None |  |
| note
| us_size | int4 | False | None |  |
| A note about this library item.
| us_source_type | varchar | False | None |  |
|-
| us_status | varchar | False | None |  |
| thumbnail
| us_timestamp | timestamptz | False | None |  |
| A small thumbnail in binary (JPG) form.
| us_user | int4 | False | None |  |
|-
| created_on
| The time when this record was created.
|-
| updated_on
| The date of update of this record.
|-
| geom
| A vector representation of the object(s), projected into WGS84 (lat/lon) and stored as a geography type.
|-
| metadata
| A JSON object containing metadata related to the spatial object.
|-
| rast
| A raster.
|}


##### user <a name="wiki.user" />
<span id="shared.spatial_library_file"></span>


| Column Name | Type | Not Null | Default | Description |
==== spatial_library_file ====
| --- | --- | --- | --- | --- |
| 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 |  |


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


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| uas_shard | int4 | False | None |  |
! Comment
| uas_value | int4 | False | None |  |
|-
| id
|  
|-
| spatial_library_id
| A link to the [[#shared.spatial_library|spatial library]].
|-
| file_id
| A link to the [[#shared.file|file]].
|}


##### user_former_groups <a name="wiki.user_former_groups" />
<span id="shared.uploaded_file"></span>


| Column Name | Type | Not Null | Default | Description |
==== uploaded_file ====
| --- | --- | --- | --- | --- |
| ufg_group | text | False | None |  |
| ufg_user | int4 | False | None |  |


##### user_groups <a name="wiki.user_groups" />
A table to store uploaded files that can be associated with other entities in separate requests. This table is intended to store temporary entities: when an uploaded file has been handled, these records should be deleted.


| Column Name | Type | Not Null | Default | Description |
:: {| class="wikitable"
| --- | --- | --- | --- | --- |
! Column
| ug_expiry | timestamptz | False | None | |
! Comment
| ug_group | text | False | None |  |
|-
| ug_user | int4 | False | None |  |
| id
|  
|-
| path
| The path to the temporary location of the file.
|-
| type
| The guessed MIME type of the file.
|-
| name
| The original name of the file.
|-
| created_on
| The time of creation of the record.
|-
| expires_on
| The expiry time of the file. It may be deleted by a maintenance script after this time.
|-
| marked_for_delete
| If true, the file is marked for delete. Otherwise it will not be touched unless there is an age limit set in the daemon.
|}


##### user_newtalk <a name="wiki.user_newtalk" />


| Column Name | Type | Not Null | Default | Description |
<span id="{schema}"></span>
| --- | --- | --- | --- | --- |
| user_id | int4 | False | None |  |
| user_ip | text | False | None |  |
| user_last_timestamp | timestamptz | False | None |  |


##### user_properties <a name="wiki.user_properties" />
== Schema: taxonomy ==


| Column Name | Type | Not Null | Default | Description |
Contains taxonomic information from a variety of sources including WoRMS, iNaturalist and the Hart list used by DFO.
| --- | --- | --- | --- | --- |
| up_property | text | False | None |  |
| up_user | int4 | False | None |  |
| up_value | text | False | None |  |


##### watchlist <a name="wiki.watchlist" />
=== Tables ===


| Column Name | Type | Not Null | Default | Description |
<span id="taxonomy.taxon"></span>
| --- | --- | --- | --- | --- |
| 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 |  |


##### watchlist_expiry <a name="wiki.watchlist_expiry" />
==== taxon ====


| Column Name | Type | Not Null | Default | Description |
Stores taxonomic names from a variety of databases in a common format distinguished by source and taxon_id.
| --- | --- | --- | --- | --- |
| we_expiry | timestamptz | False | None |  |
| we_item | int4 | False | None |  |


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

Latest revision as of 02:44, 21 September 2025

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

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

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

Comments on MSEA's tables are managed using DDL, as described on the Database Upgrades page. Many other tables are generated by application frameworks and are not documented.

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

Schema: admin

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

Tables

cache_table

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

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


Schema: cache

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

Tables

cruise_stats

Stores compiled statistics for cruises.

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

cruise_track

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

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

dive_track

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

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

evt_depth

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

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

evt_measurement

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

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

evt_pos

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

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

transect_track

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

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


Schema: geo

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

Tables

area

Stores area geometries linked to area groups.

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

area_group

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

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


Schema: maxmind

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

Tables

geoip_city_blocks

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

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

geoip_city_locations

Stores the country, region and city data for GeoIP.

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

geoip_last_update

Stores the time of last update of the database.

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


Schema: ndst

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

Tables

cruise

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

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

diveconfig

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

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

dives

Stores information about each dive.

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

equipconfig

Stores configurations for equipment, including instruments and platforms.

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

equipment

Stores equipment, including instruments and platforms.

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

people

Stores the people who worked on the cruise.

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

transects

Stores information about each transect.

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


Schema: public

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

Tables

auth_group

A Django table for authorization groups.

Column Comment
id
name

auth_group_permissions

A Django table for permissions on authorization groups.

Column Comment
id
group_id
permission_id

auth_permission

A Django table for available permissions.

Column Comment
id
name
content_type_id
codename

auth_user

A Django table for users.

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

auth_user_groups

A Django table to relate users to groups.

Column Comment
id
user_id
group_id

auth_user_user_permissions

A Django for user permissions.

Column Comment
id
user_id
permission_id

django_admin_log

A Django table for admin logging.

Column Comment
id
action_time
object_id
object_repr
action_flag
change_message
content_type_id
user_id

django_celery_beat_clockedschedule

Column Comment
id
clocked_time

django_celery_beat_crontabschedule

Column Comment
id
minute
hour
day_of_week
day_of_month
month_of_year
timezone

django_celery_beat_intervalschedule

Column Comment
id
every
period

django_celery_beat_periodictask

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

django_celery_beat_periodictasks

Column Comment
ident
last_update

django_celery_beat_solarschedule

Column Comment
id
event
latitude
longitude

django_celery_results_chordcounter

Column Comment
id
group_id
sub_tasks
count

django_celery_results_groupresult

Column Comment
id
group_id
date_created
date_done
content_type
content_encoding
result

django_celery_results_taskresult

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

django_content_type

A Django table for content types.

Column Comment
id
app_label
model

django_migrations

Records migrations applied to database.

Column Comment
id
app
name
applied

django_session

Django session management.

Column Comment
session_key
session_data
expire_date

django_site

Column Comment
id
domain
name

event_group

Column Comment
event_id
group_id

knox_authtoken

Column Comment
digest
created
user_id
expiry
token_key

spatial_ref_sys

Column Comment
srid
auth_name
auth_srid
srtext
proj4text

thumbnail_kvstore

Column Comment
key
value


Views

geography_columns

Column Comment
f_table_catalog
f_table_schema
f_table_name
f_geography_column
coord_dimension
srid
type

geometry_columns

Column Comment
f_table_catalog
f_table_schema
f_table_name
f_geometry_column
coord_dimension
srid
type


Functions

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

Procedures

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

Schema: rov

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

Tables

abundance

Stores a list of abundance labels from the ACFOR scale.

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

annotation_job

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

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

annotation_job_annotation_protocol

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

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

annotation_job_crew

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

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

annotation_job_role

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

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

annotation_protocol

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

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

annotation_protocol_document

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

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

annotation_software

The software used for annotation.

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

biigle_label_map

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

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

biigle_label_map_restriction

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

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

biocover

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

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

complexity

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

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

coverage

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

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

cruise

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

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

cruise_crew

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

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

cruise_document

Stores information about documents related to a cruise.

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

cruise_fn_contact

A table for associating First Nations contacts with a cruise.

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

cruise_import

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

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

cruise_program

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

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

cruise_role

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

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

disturbance

Provides a nominal level of disturbance for habitat events.

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

dive

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

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

dive_crew

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

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

dive_role

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

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

equipment_type

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

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

event

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

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

event_group

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

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

event_logger

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

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

flow

Stores categories of current flow for habitat.

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

generic_label_map

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

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

generic_label_map_restriction

Links a generic label mapping to a restriction.

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

image_quality

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

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

import_group

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

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

import_queue_annotator

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

Column Comment
id
user_id A reference to the MSEA user that created the record.
note An optional note about the import package.
created_on The date of creation of the record.
updated_on The date of update of the record.
name A unique name for the import queue record.
status A short description of the processing status of the job.
cruise_name The name of the cruise to which this record is linked. A lookup is not used because the cruise record may not have been created yet.
data Stores the JSON representation of the import job.
hidden
objective
start_date
end_date

import_queue_annotator_label_map_prefill

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

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

import_queue_pi

Stores the import packages created by principal investigators.

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

instrument

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

Column Comment
id
model_id A reference to the instrument model.
serial_number The serial number of the instrument. If a serial number is not available, some unique identifier can be substituted. No two instruments of the same model may have the same serial number.
retired If the instrument is retired, this records the retirement date. If null, the instrument is assumed to be active.
attributes A freeform list of attributes for this instrument.
note An optional note about this instrument.
created_on The date of creation of this record.
updated_on The date of update of this record.
organisation_id A reference to the organisation that owns and operates the instrument.
name A name for the instrument to distinguish it from others of the same model.

instrument_config

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

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

measurement

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

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

measurement_type

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

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

medium_format

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

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

medium_type

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

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

model

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

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

observation_confidence

Provides a nominal observation confidence level for observation events.

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

orientation

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

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

orientation_type

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

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

platform

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

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

platform_config

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

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

position

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

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

position_type

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

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

program

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

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

program_member

Assigns user roles to a program.

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

program_role

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

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

protocol

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

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

relief

Provides a nominal level of terrain relief for habitat events.

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

signup_area

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

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

status_type

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

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

status_type_detail

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

Column Comment
id
status_type_id A reference to the status type.
name The status type detail. This field distinguishes different uses for status types. For example, there can be more than one reason to record an "Off Transect" event.
note Optional extended description of detail.
short_code Contains a short code that can be used to look up a status type detail (e.g., during import) without relying on the primary key.

substrate

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

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

survey_mode

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

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

thickness

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

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

transect

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

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

weather_observation

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

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


Schema: shared

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

Tables

db_version

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

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

file

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

Column Comment
id
file_type_id An optional reference to the file type.
name The name for the file.
description An optional description for the file.
metadata A JSON dictionary containing metadata relating to the file.
path A path of the file, relative to the root directory where files are stored.
created_on The creation time of the file record, not necessarily the file itself (this should be stored in metadata).
updated_on The update time of the file record, not necessarily the file itself (this should be stored in metadata).
hash And MD5 hash of the file data. Used to compare files and search for identical versions.
blob_url A URL referencing the file in online blob storage. This field is subject to change depending on where the files reside and will change if they're moved.

file_type

A list of file types.

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

mseauser

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

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

organisation

Convenient storage for organisations involved in MSEA activities.

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

person

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

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

restriction

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

Column Comment
id
name The name of the restriction.
key The top-level property name or key.
pattern A pattern matching the property value using the SQL ILIKE operator. An exact (case-insensitive) match is a bare string, while appending % at any location is a wildcard match. For example, '%term' matches 'exterm' but not 'exterminate'.
note An optional note about the restriction.
created_on The date of creation of the restriction.
updated_on The date of last update of the restriction.

restriction_group

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

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

site

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

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

spatial_library

Maintains a library of spatial data.

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

spatial_library_file

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

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

uploaded_file

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

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


Schema: taxonomy

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

Tables

taxon

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

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