PKGBUILD/pkg/repository/db/sqlite3/createTableSensors.sql
Markus Pesch 43e9d00dcb
fix: implement repository test
changes:
- Implement repository test for the sqlite backend
- Add testutils package to start container images
- Remove deprecated till_date in measured values
- Renamed columns of the table humidities, pressures and temperatures
2020-06-01 00:56:04 +02:00

15 lines
841 B
SQL

CREATE TABLE IF NOT EXISTS sensors (
sensor_id CHAR(37) PRIMARY KEY,
sensor_name VARCHAR(64) NOT NULL,
sensor_location VARCHAR(64),
wire_id VARCHAR(64),
i2c_bus VARCHAR(255),
i2c_address VARCHAR(12),
gpio_number VARCHAR(6),
sensor_model VARCHAR(16) NOT NULL,
sensor_enabled INTEGER(1) DEFAULT 1 NOT NULL,
tick_duration VARCHAR(6) NOT NULL,
device_id CHAR(37) NOT NULL,
creation_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(device_id) REFERENCES devices(device_id)
);