Sensors
The sensors table stores information about the individual sensors used to collect data.
Table Schema
| Column Name | Data Type | Description |
|---|---|---|
id |
UUID |
Primary Key. A unique identifier for the sensor. |
sensor_name |
String(255) |
The name of the sensor. This column has a unique constraint. |
sensor_type_id |
Integer |
Foreign Key. References the id of the sensor type in the sensor_types table. |
sensor_data_type_id |
Integer |
Foreign Key. References the id of the data type in the data_types table. |
sensor_data_format_id |
Integer |
Foreign Key. References the id of the data format in the data_formats table. |
sensor_info |
JSONB |
A JSONB column for storing additional, unstructured information about the sensor. |
created_at |
TIMESTAMP |
The timestamp when the record was created. Defaults to the current time. |
updated_at |
TIMESTAMP |
The timestamp when the record was last updated. Automatically updates on any modification. |
Constraints and Indexes
- Unique Constraint: A
UniqueConstraintonsensor_nameensures that each sensor has a unique name. - GIN Index: A GIN index named
idx_sensors_infois applied to thesensor_infocolumn to optimize queries on the JSONB data.
Relationships
sensor_type: A many-to-one relationship with thesensor_typestable.data_type: A many-to-one relationship with thedata_typestable.data_format: A many-to-one relationship with thedata_formatstable.- Association Tables: The
sensorstable is linked tosensor_platforms,experiments, anddatasetsthrough association tables.