* System stats

* Last callers rewritten using format and VM
* Some minor MCI stuff
This commit is contained in:
Bryan Ashby 2015-10-17 20:03:51 -06:00
parent d02d9e4a7c
commit 1c1f4394ca
15 changed files with 126 additions and 39 deletions

View file

@ -17,11 +17,13 @@ function getDatabasePath(name) {
}
function initializeDatabases() {
// :TODO: this will need to change if more DB's are added
// :TODO: this will need to change if more DB's are added ... why?
dbs.user = new sqlite3.Database(getDatabasePath('user'));
dbs.message = new sqlite3.Database(getDatabasePath('message'));
dbs.system = new sqlite3.Database(getDatabasePath('system'));
dbs.user.serialize(function serialized() {
createSystemTables();
createUserTables();
createInitialUserValues();
});
@ -32,6 +34,15 @@ function initializeDatabases() {
});
}
function createSystemTables() {
dbs.system.run(
'CREATE TABLE IF NOT EXISTS system_property (' +
' prop_name VARCHAR PRIMARY KEY NOT NULL,' +
' prop_value VARCHAR NOT NULL' +
');'
);
}
function createUserTables() {
dbs.user.run(
'CREATE TABLE IF NOT EXISTS user (' +