From 1690248e240aa2b61b3e0a223393dec69a812061 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 19 Jan 2020 09:08:33 +0100 Subject: [PATCH] migration script to fix contentLength = -1 in new notes --- db/migrations/0157__fix_contentLength.sql | 1 + src/services/app_info.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 db/migrations/0157__fix_contentLength.sql diff --git a/db/migrations/0157__fix_contentLength.sql b/db/migrations/0157__fix_contentLength.sql new file mode 100644 index 000000000..63bb6ad35 --- /dev/null +++ b/db/migrations/0157__fix_contentLength.sql @@ -0,0 +1 @@ +UPDATE notes SET contentLength = COALESCE((SELECT COALESCE(LENGTH(content), 0) FROM note_contents WHERE note_contents.noteId = notes.noteId), -1); \ No newline at end of file diff --git a/src/services/app_info.js b/src/services/app_info.js index 587d11e62..0c30da676 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 = 156; +const APP_DB_VERSION = 157; const SYNC_VERSION = 14; const CLIPPER_PROTOCOL_VERSION = "1.0";