From 0ff250fe154c1d06764440e411a5cb43b72d8c01 Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 22 Jan 2019 20:34:45 +0100 Subject: [PATCH] font sizes were not created for new documents - fix plus migration for existing ones --- db/migrations/0124__readd_font_sizes.sql | 11 +++++++++++ src/services/app_info.js | 2 +- src/services/options_init.js | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 db/migrations/0124__readd_font_sizes.sql diff --git a/db/migrations/0124__readd_font_sizes.sql b/db/migrations/0124__readd_font_sizes.sql new file mode 100644 index 000000000..6753b6b7c --- /dev/null +++ b/db/migrations/0124__readd_font_sizes.sql @@ -0,0 +1,11 @@ +INSERT INTO options (name, value, dateCreated, dateModified, isSynced) + SELECT 'mainFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0 + WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'mainFontSize'); + +INSERT INTO options (name, value, dateCreated, dateModified, isSynced) + SELECT 'treeFontSize', '100', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0 + WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'treeFontSize'); + +INSERT INTO options (name, value, dateCreated, dateModified, isSynced) + SELECT 'detailFontSize', '110', '2019-01-13T18:31:00.874Z', '2019-01-13T18:31:00.874Z', 0 + WHERE NOT EXISTS (SELECT 1 FROM options WHERE name = 'detailFontSize'); \ No newline at end of file diff --git a/src/services/app_info.js b/src/services/app_info.js index 20e20323a..2dd364356 100644 --- a/src/services/app_info.js +++ b/src/services/app_info.js @@ -4,7 +4,7 @@ const build = require('./build'); const packageJson = require('../../package'); const {TRILIUM_DATA_DIR} = require('./data_dir'); -const APP_DB_VERSION = 123; +const APP_DB_VERSION = 124; const SYNC_VERSION = 4; module.exports = { diff --git a/src/services/options_init.js b/src/services/options_init.js index bbc2e7ba9..09daf11f4 100644 --- a/src/services/options_init.js +++ b/src/services/options_init.js @@ -49,6 +49,10 @@ async function initNotSyncedOptions(initialized, startNotePath = 'root', syncSer await optionService.createOption('syncServerTimeout', 5000, false); await optionService.createOption('syncProxy', syncProxy, false); + await optionService.createOption('mainFontSize', '100', false); + await optionService.createOption('treeFontSize', '100', false); + await optionService.createOption('detailFontSize', '110', false); + await optionService.createOption('initialized', initialized ? 'true' : 'false', false); }