PKGBUILD/pkg/repository/db/postgres/insertOrUpdateTemperature.sql
markus 522fe2746a
fix: add or update devices, sensors and measured values
Add additional functions to the repository to add or update devices,
sensors or measured values. Furthermore the test has been adapt to the
new functions.
2020-12-14 20:54:20 +01:00

16 lines
275 B
SQL

INSERT INTO temperatures (
id,
value,
date,
sensor_id,
creation_date,
update_date
)
VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT (id)
DO
UPDATE SET
value = EXCLUDED.value,
date = EXCLUDED.date,
sensor_id = EXCLUDED.sensor_id,
update_date = NOW();