Now using macaddr datatype and added test for adding devices and displaynames
All checks were successful
Build Project / test (push) Successful in 6m32s

This commit is contained in:
2025-01-04 17:06:13 +00:00
parent 1466075b7b
commit f76f248446
9 changed files with 174 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
-- Add migration script here
CREATE TABLE Devices (
ID CHAR(32) PRIMARY KEY,
ID MACADDR PRIMARY KEY,
display_name VARCHAR(255)
);

View File

@@ -5,6 +5,6 @@ CREATE TABLE Telemetry (
Voltage FLOAT,
Temperature FLOAT,
uptime INT NOT NULL,
device_id CHAR(32) NOT NULL,
device_id MACADDR NOT NULL,
FOREIGN KEY (device_id) REFERENCES Devices(ID)
);

View File

@@ -3,7 +3,7 @@ CREATE TABLE Values (
timestamp TIMESTAMP NOT NULL,
value FLOAT NOT NULL,
value_id INT NOT NULL,
device_id CHAR(32) NOT NULL,
device_id MACADDR NOT NULL,
active_errors INT NOT NULL,
FOREIGN KEY (device_id) REFERENCES Devices(ID)
);