From 2f720df9d200f03b907efee43345f3793b9f69f8 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 16 Sep 2020 20:51:57 +0200 Subject: [PATCH] migration to convert H1 to H2, #1240 --- db/migrations/0169__convert_h1_to_h2.js | 18 ++++++++++++++++++ src/services/app_info.js | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 db/migrations/0169__convert_h1_to_h2.js diff --git a/db/migrations/0169__convert_h1_to_h2.js b/db/migrations/0169__convert_h1_to_h2.js new file mode 100644 index 000000000..14696580e --- /dev/null +++ b/db/migrations/0169__convert_h1_to_h2.js @@ -0,0 +1,18 @@ +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(); + + content = content + .replace(/