write voltage to database

This commit is contained in:
2023-05-17 22:00:39 +02:00
parent 3c932220e7
commit 36d18dcb79
2 changed files with 13 additions and 0 deletions

View File

@ -26,6 +26,15 @@ CREATE TABLE measurement_t (
SELECT create_hypertable('measurement_t', 'time');
CREATE TABLE voltage_t (
time TIMESTAMP WITHOUT TIME ZONE NOT NULL,
device_name VARCHAR(16) NOT NULL,
voltage INTEGER
);
SELECT create_hypertable('voltage_t', 'time');
insert into device_t (device_id, label) values('eui-43fa12f400006c88', 'badesee');
insert into sensor_t (address, label, index, device)
values (13258914387362694952, '0,5m ', 0, 1),
@ -36,3 +45,4 @@ insert into sensor_t (address, label, index, device)
create user preprocessor password 'geheim';
grant select on device_t, sensor_t to preprocessor;
grant insert on measurement_t to preprocessor;
grant insert on voltage_t to preprocessor;