sinkserver/schema/createSchema.sql

10 lines
335 B
MySQL
Raw Normal View History

2021-04-29 16:13:27 +02:00
CREATE SEQUENCE device_s START WITH 1 INCREMENT BY 1;
CREATE TABLE device_t (
id integer PRIMARY KEY DEFAULT NEXTVAL('device_s'),
2021-04-29 16:40:58 +02:00
deviceid varchar(16) UNIQUE NOT NULL,
2021-04-29 17:55:29 +02:00
sharedsecret varchar(31) NOT NULL CHECK(char_length(sharedSecret) = 31),
2021-04-29 17:17:40 +02:00
location varchar(128) NOT NULL,
2021-04-29 16:13:27 +02:00
active boolean NOT NULL DEFAULT false
2021-04-29 17:17:40 +02:00
);