2021-01-30 14:44:21 +00:00
|
|
|
CREATE TABLE temperatures (
|
|
|
|
id CHAR(36) NOT NULL,
|
2020-06-01 20:36:57 +00:00
|
|
|
value NUMERIC(10,3) NOT NULL,
|
2020-10-07 21:38:27 +00:00
|
|
|
date TIMESTAMP WITH TIME ZONE NOT NULL,
|
2020-06-01 20:36:57 +00:00
|
|
|
sensor_id CHAR(36) NOT NULL,
|
2020-10-07 21:38:27 +00:00
|
|
|
creation_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
2021-01-30 14:44:21 +00:00
|
|
|
update_date TIMESTAMP WITH TIME ZONE,
|
|
|
|
CONSTRAINT pk_temperatures PRIMARY KEY (id),
|
|
|
|
CONSTRAINT fk_temperatures_sensor_id FOREIGN KEY (sensor_id) REFERENCES sensors(sensor_id) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
);
|