From f3b98c5644b47165da952e493c25a468b440296e Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 3 Jan 2016 15:53:27 -0700 Subject: [PATCH] Fix callback, add some WIP commented out concepts --- core/database.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/core/database.js b/core/database.js index 0fefffea..1b8f9afa 100644 --- a/core/database.js +++ b/core/database.js @@ -61,17 +61,33 @@ function initializeDatabases(cb) { }); } ], - cb + function complete(err) { + cb(err); + } ); } function createSystemTables() { dbs.system.run( - 'CREATE TABLE IF NOT EXISTS system_property (' + + 'CREATE TABLE IF NOT EXISTS system_property (' + ' prop_name VARCHAR PRIMARY KEY NOT NULL,' + ' prop_value VARCHAR NOT NULL' + ');' ); + + // + // system_log can round log_timestamp for daily, monthly, etc. + // statistics as well as unique entries. + // +/* + dbs.system.run( + 'CREATE TABLE IF NOT EXISTS system_log (' + + ' log_timestamp DATETIME PRIMARY KEY NOT NULL ( ' + + ' log_name VARCHARNOT NULL,' + + ' log_value VARCHAR NOT NULL,' + + ' UNIQUE(log_timestamp, log_name)' + + ');' + );*/ } function createUserTables() { @@ -123,7 +139,7 @@ function createMessageBaseTables() { ' from_user_name VARCHAR NOT NULL,' + ' subject,' + // FTS @ message_fts ' message,' + // FTS @ message_fts - ' modified_timestamp DATETIME NOT NULL,' + + ' modified_timestamp DATETIME NOT NULL,' + ' view_count INTEGER NOT NULL DEFAULT 0,' + ' UNIQUE(message_uuid)' + ');'