diff --git a/README.md b/README.md index 5216266..8f0a031 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,8 @@ por el puesto de programador Go. ### Obtener valores de un sensor - Campo obligatorio: `sensor_id`. -- Campos opcionales: `from` y `to` en formato RFC3339. Si no se especifican, se toman los últimos 7 días. +- Campos opcionales: `from` y `to` en formato RFC3339. Si no se especifican, +se toman los últimos 7 días. `nats req sensors.values.get '{ "sensor_id": "sensor-001", diff --git a/app/database/001_sensors.up.sql b/app/database/001_sensors.up.sql index cd8054b..ac75724 100644 --- a/app/database/001_sensors.up.sql +++ b/app/database/001_sensors.up.sql @@ -34,4 +34,13 @@ create table registry timescaledb.hypertable, timescaledb.partition_column = 'created_at', timescaledb.segmentby = 'sensor_id' - ); \ No newline at end of file + ); + +insert into sensors (sensor_id, sensor_type, sampling_interval, threshold_above, threshold_below) +values + ('temp-001', 'temperature', 10, 100, 0), + ('hum-001', 'humidity', 15, 80, 20), + ('co2-001', 'carbon_dioxide', 20, 1000, 400), + ('pres-001', 'pressure', 30, 1050, 950), + ('prox-001', 'proximity', 5, 200, 0), + ('light-001', 'light', 10, 10000, 0); \ No newline at end of file