diff --git a/bin/www b/bin/www index ca32874bb..5110e3f5b 100755 --- a/bin/www +++ b/bin/www @@ -18,6 +18,7 @@ const log = require('../services/log'); const app_info = require('../services/app_info'); const messaging = require('../services/messaging'); const utils = require('../services/utils'); +const sql = require('../services/sql'); const port = normalizePort(config['Network']['port'] || '3000'); app.set('port', port); @@ -53,7 +54,7 @@ httpServer.listen(port); httpServer.on('error', onError); httpServer.on('listening', onListening); -messaging.init(httpServer, sessionParser); +sql.dbReady.then(() => messaging.init(httpServer, sessionParser)); if (utils.isElectron()) { const electronRouting = require('../routes/electron'); diff --git a/export-schema.sh b/export-schema.sh new file mode 100755 index 000000000..95cc7655d --- /dev/null +++ b/export-schema.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +sqlite3 ~/trilium-data/document.db .schema > schema.sql \ No newline at end of file diff --git a/migrations/0049__rename_start_note_tree_id_to_note_path.sql b/migrations/0049__rename_start_note_tree_id_to_note_path.sql new file mode 100644 index 000000000..0ba12b4e9 --- /dev/null +++ b/migrations/0049__rename_start_note_tree_id_to_note_path.sql @@ -0,0 +1 @@ +UPDATE options SET opt_name = 'start_note_path' WHERE opt_name = 'start_note_tree_id'; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5ec4549df..df1b5b6e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2419,19 +2419,19 @@ "integrity": "sha1-zIcsFoiArjxxiXYv1f/ACJbJUYo=" }, "electron": { - "version": "1.8.2-beta.2", - "resolved": "https://registry.npmjs.org/electron/-/electron-1.8.2-beta.2.tgz", - "integrity": "sha1-tTLHEFDd0tSwDi4NNV3k51vB5f0=", + "version": "1.8.2-beta.3", + "resolved": "https://registry.npmjs.org/electron/-/electron-1.8.2-beta.3.tgz", + "integrity": "sha1-Ljkcy9YnaKOzsmC48uPxZHNWeuw=", "requires": { - "@types/node": "8.0.49", + "@types/node": "8.0.56", "electron-download": "3.3.0", "extract-zip": "1.6.5" }, "dependencies": { "@types/node": { - "version": "8.0.49", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.49.tgz", - "integrity": "sha512-Oq3cV/mrMKy6Tv42llfS8YIH30ooDdhbJ40h1zoWl+goOJw8Kjy8j8RfjGZtZIUDO0gLwCfcbYM7+LModnbeMw==" + "version": "8.0.56", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.56.tgz", + "integrity": "sha512-JAlQv3hUWbrnruuTiLDf1scd4F/TBT0LgGEe+BBeF3p/Rc3yL6RV57WJN2nK5i+BshEz1sDllwH0Fzbuo7G4QA==" } } }, @@ -2590,7 +2590,7 @@ }, "fs-extra": { "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "requires": { "graceful-fs": "4.1.11", @@ -2807,6 +2807,23 @@ "yargs": "6.6.0" }, "dependencies": { + "@types/node": { + "version": "8.0.56", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.56.tgz", + "integrity": "sha512-JAlQv3hUWbrnruuTiLDf1scd4F/TBT0LgGEe+BBeF3p/Rc3yL6RV57WJN2nK5i+BshEz1sDllwH0Fzbuo7G4QA==", + "dev": true + }, + "electron": { + "version": "1.8.2-beta.2", + "resolved": "https://registry.npmjs.org/electron/-/electron-1.8.2-beta.2.tgz", + "integrity": "sha1-tTLHEFDd0tSwDi4NNV3k51vB5f0=", + "dev": true, + "requires": { + "@types/node": "8.0.56", + "electron-download": "3.3.0", + "extract-zip": "1.6.5" + } + }, "yargs": { "version": "6.6.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", diff --git a/package.json b/package.json index 2476f4942..cd7c317df 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "debug": "~3.1.0", "devtron": "^1.4.0", "ejs": "~2.5.7", - "electron": "^1.8.2-beta.2", + "electron": "^1.8.2-beta.3", "electron-debug": "^1.0.0", "express": "~4.16.2", "express-session": "^1.15.6", diff --git a/public/javascripts/context_menu.js b/public/javascripts/context_menu.js index 9f5043363..59e498479 100644 --- a/public/javascripts/context_menu.js +++ b/public/javascripts/context_menu.js @@ -19,7 +19,7 @@ const contextMenu = (function() { // just do nothing } else { - throw new Error("Unrecognized clipboard mode=" + clipboardMode); + throwError("Unrecognized clipboard mode=" + clipboardMode); } clipboardId = null; @@ -36,7 +36,7 @@ const contextMenu = (function() { treeChanges.cloneNoteTo(clipboardId, node.data.note_id); } else { - throw new Error("Unrecognized clipboard mode=" + mode); + throwError("Unrecognized clipboard mode=" + mode); } clipboardId = null; diff --git a/public/javascripts/dialogs/note_history.js b/public/javascripts/dialogs/note_history.js index a6da3321b..3bbbfd2c8 100644 --- a/public/javascripts/dialogs/note_history.js +++ b/public/javascripts/dialogs/note_history.js @@ -27,7 +27,7 @@ const noteHistory = (function() { historyItems = await server.get('notes-history/' + noteId); for (const item of historyItems) { - const dateModified = getDateFromTS(item.date_modified_to); + const dateModified = getDateFromTS(item.date_modified_from); $("#note-history-list").append($('