|
|
@@ -1,8 +1,9 @@
|
|
|
const sqlite3 = require('sqlite3'),
|
|
|
updateAccountTable = require('./models/accounts.js').updateTable,
|
|
|
- updateAccountConfigTable = require('./models/accountConfig.js').updateTable;
|
|
|
+ updateAccountConfigTable = require('./models/accountConfig.js').updateTable,
|
|
|
+ config = require("../config.js");
|
|
|
|
|
|
-const DB_PATH = __dirname +"/../database.sqlite",
|
|
|
+const DB_PATH = config.db || (__dirname +"/../database.sqlite"),
|
|
|
DB_VERSION = 3;
|
|
|
|
|
|
function updateMetaTable(dbObj, currentVersion, cb) {
|
|
|
@@ -60,6 +61,7 @@ Database.prototype.updateTables = function(cb, currentVersion) {
|
|
|
Database.prototype.initDb = function(cb) {
|
|
|
var self = this;
|
|
|
if (!self.db) {
|
|
|
+ console.log("DB: " +DB_PATH);
|
|
|
self.db = new sqlite3.Database(DB_PATH, sqlite3.OPEN_READWRITE, (err) => {
|
|
|
if (err) {
|
|
|
if (err.code === "SQLITE_CANTOPEN") {
|