From c2f1be4a0dbb65bf258c1c4e7802f2939591b438 Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Sat, 31 Jul 2021 14:27:05 -0700 Subject: [PATCH] Add profiles table --- server/boot/db.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/server/boot/db.js b/server/boot/db.js index b3c4b48..4927004 100644 --- a/server/boot/db.js +++ b/server/boot/db.js @@ -2,6 +2,32 @@ const db = require('../db') module.exports = function () { db.serialize(function () { - db.run('CREATE TABLE IF NOT EXISTS users ( username TEXT UNIQUE, hashed_password BLOB, salt BLOB, name TEXT)') + db.run(`CREATE TABLE IF NOT EXISTS users ( + id INTEGER PRIMARY KEY, + username TEXT UNIQUE, + hashed_password BLOB, + salt BLOB, + name TEXT)` + ) + + db.run(`CREATE TABLE IF NOT EXISTS profiles ( + name TEXT UNIQUE, + timer_enabled INTEGER, + timer_seconds INTEGER, + volume INTEGER, + noise_color TEXT, + filter_enabled INTEGER, + filter_type TEXT, + filter_cutoff INTEGER, + filter_cutoff_lfo_enabled INTEGER, + filter_cutoff_lfo_rate REAL, + filter_cutoff_lfo_min INTEGER, + filter_cutoff_lfo_max INTEGER, + tremolo_enabled INTEGER, + tremolo_frequency REAL, + tremolo_depth REAL, + user INTEGER, + FOREIGN KEY(user) REFERENCES user(id))` + ) }) }