Special-IO/docs/database.sql
Finn Dane 7659efad5f
All checks were successful
continuous-integration/drone/push Build is passing
adds database layout as file
2023-11-16 14:59:31 +01:00

14 lines
358 B
SQL

CREATE TABLE IF NOT EXISTS sensor(
sensorId INTEGER NOT NULL PRIMARY KEY,
resolution REAL NOT NULL,
accuracy REAL NOT NULL
);
CREATE TABLE IF NOT EXISTS dataPoint(
dataPointId INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
sensorFK INTEGER NOT NULL,
timestamp INTEGER NOT NULL,
value REAL NOT NULL,
FOREIGN KEY(sensorFK) REFERENCES sensor(sensorId)
);