Add profiles table

This commit is contained in:
Kevin Thomas
2021-07-31 14:27:05 -07:00
parent 1eff31e79f
commit c2f1be4a0d

View File

@@ -2,6 +2,32 @@ const db = require('../db')
module.exports = function () { module.exports = function () {
db.serialize(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))`
)
}) })
} }