CREATE TABLE devices (
    device_id TEXT PRIMARY KEY NOT NULL,
    name TEXT NOT NULL DEFAULT "My wonderful plant"
);

CREATE TABLE data (
    device_id TEXT NOT NULL REFERENCES devices(device_id),
    timestamp DATETIME NOT NULL,
    value NUMERIC NOT NULL,
    PRIMARY KEY (device_id, timestamp)
);

