You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
702 B

DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS status;
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE status (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
status BOOLEAN NOT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES user (id)
);
INSERT INTO status (user_id, status) VALUES (1, 1);
CREATE TABLE settings (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT UNIQUE NOT NULL,
value TEXT UNIQUE NOT NULL
);
INSERT INTO settings (name, value) VALUES ('GPIO pin', '17');
INSERT INTO settings (name, value) VALUES ('Registration', 'enabled');