From 71894c34aa4781497ace8f847927ef7e05c8dfaa Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 3 Oct 2020 20:51:14 +0200 Subject: [PATCH] fix migration so that only really changed notes are updated, #1254 --- db/migrations/0169__convert_h1_to_h2.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/db/migrations/0169__convert_h1_to_h2.js b/db/migrations/0169__convert_h1_to_h2.js index 14696580e..f1c2cc4bd 100644 --- a/db/migrations/0169__convert_h1_to_h2.js +++ b/db/migrations/0169__convert_h1_to_h2.js @@ -3,13 +3,15 @@ const repository = require('../../src/services/repository'); module.exports = () => { for (const note of repository.getEntities("SELECT * FROM notes WHERE type = 'text' AND isProtected = 0")) { try { - let content = note.getContent(); + let origContent = note.getContent(); - content = content + const newContent = origContent .replace(/