Skip to content

Instantly share code, notes, and snippets.

@garystafford
Created October 5, 2020 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/2d2e51c51cb579b5cfe3c7da3fd9b78b to your computer and use it in GitHub Desktop.
Save garystafford/2d2e51c51cb579b5cfe3c7da3fd9b78b to your computer and use it in GitHub Desktop.
CREATE TABLE IF NOT EXISTS sensor_data (
time timestamptz NOT NULL,
device_id text NOT NULL,
temperature double PRECISION NOT NULL,
humidity double PRECISION NOT NULL,
lpg double PRECISION NOT NULL,
co double PRECISION NOT NULL,
smoke double PRECISION NOT NULL,
light boolean NOT NULL,
motion boolean NOT NULL
);
SELECT create_hypertable('sensor_data', 'time');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment