mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	added migration to add excludeFromTreeMap for journal subtrees
This commit is contained in:
		
							
								
								
									
										15
									
								
								db/migrations/0184__add_excludeFromTreeMap_to_journal.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								db/migrations/0184__add_excludeFromTreeMap_to_journal.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | const becca = require('../../src/becca/becca'); | ||||||
|  | const beccaLoader = require('../../src/becca/becca_loader'); | ||||||
|  | const cls = require('../../src/services/cls'); | ||||||
|  |  | ||||||
|  | module.exports = () => { | ||||||
|  |     cls.init(() => { | ||||||
|  |         beccaLoader.load(); | ||||||
|  |  | ||||||
|  |         for (const note of Object.values(becca.notes)) { | ||||||
|  |             if (note.hasLabel('calendarRoot')) { | ||||||
|  |                 note.addLabel('excludeFromTreeMap', "", true); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     }); | ||||||
|  | }; | ||||||
							
								
								
									
										54
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										54
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -584,9 +584,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "@tootallnate/once": { |     "@tootallnate/once": { | ||||||
|       "version": "1.0.0", |       "version": "2.0.0", | ||||||
|       "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.0.0.tgz", |       "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", | ||||||
|       "integrity": "sha512-KYyTT/T6ALPkIRd2Ge080X/BsXvy9O0hcWTtMWkPvwAwF99+vn6Dv4GzrFT/Nn1LePr+FFDbRXXlqmsy9lw2zA==" |       "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" | ||||||
|     }, |     }, | ||||||
|     "@types/cacheable-request": { |     "@types/cacheable-request": { | ||||||
|       "version": "6.0.2", |       "version": "6.0.2", | ||||||
| @@ -4597,11 +4597,11 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "http-proxy-agent": { |     "http-proxy-agent": { | ||||||
|       "version": "4.0.1", |       "version": "5.0.0", | ||||||
|       "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", |       "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", | ||||||
|       "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", |       "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", | ||||||
|       "requires": { |       "requires": { | ||||||
|         "@tootallnate/once": "1", |         "@tootallnate/once": "2", | ||||||
|         "agent-base": "6", |         "agent-base": "6", | ||||||
|         "debug": "4" |         "debug": "4" | ||||||
|       } |       } | ||||||
| @@ -5152,6 +5152,11 @@ | |||||||
|         "xml-name-validator": "^3.0.0" |         "xml-name-validator": "^3.0.0" | ||||||
|       }, |       }, | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|  |         "@tootallnate/once": { | ||||||
|  |           "version": "1.1.2", | ||||||
|  |           "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", | ||||||
|  |           "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" | ||||||
|  |         }, | ||||||
|         "form-data": { |         "form-data": { | ||||||
|           "version": "4.0.0", |           "version": "4.0.0", | ||||||
|           "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", |           "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", | ||||||
| @@ -5162,6 +5167,16 @@ | |||||||
|             "mime-types": "^2.1.12" |             "mime-types": "^2.1.12" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|  |         "http-proxy-agent": { | ||||||
|  |           "version": "4.0.1", | ||||||
|  |           "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", | ||||||
|  |           "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", | ||||||
|  |           "requires": { | ||||||
|  |             "@tootallnate/once": "1", | ||||||
|  |             "agent-base": "6", | ||||||
|  |             "debug": "4" | ||||||
|  |           } | ||||||
|  |         }, | ||||||
|         "parse5": { |         "parse5": { | ||||||
|           "version": "6.0.1", |           "version": "6.0.1", | ||||||
|           "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", |           "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", | ||||||
| @@ -5552,6 +5567,25 @@ | |||||||
|         "promise-retry": "^2.0.1", |         "promise-retry": "^2.0.1", | ||||||
|         "socks-proxy-agent": "^5.0.0", |         "socks-proxy-agent": "^5.0.0", | ||||||
|         "ssri": "^8.0.0" |         "ssri": "^8.0.0" | ||||||
|  |       }, | ||||||
|  |       "dependencies": { | ||||||
|  |         "@tootallnate/once": { | ||||||
|  |           "version": "1.1.2", | ||||||
|  |           "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", | ||||||
|  |           "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", | ||||||
|  |           "dev": true | ||||||
|  |         }, | ||||||
|  |         "http-proxy-agent": { | ||||||
|  |           "version": "4.0.1", | ||||||
|  |           "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", | ||||||
|  |           "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", | ||||||
|  |           "dev": true, | ||||||
|  |           "requires": { | ||||||
|  |             "@tootallnate/once": "1", | ||||||
|  |             "agent-base": "6", | ||||||
|  |             "debug": "4" | ||||||
|  |           } | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "markdown-it": { |     "markdown-it": { | ||||||
| @@ -5813,9 +5847,9 @@ | |||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "node-abi": { |     "node-abi": { | ||||||
|       "version": "3.0.0", |       "version": "3.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.0.0.tgz", |       "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.1.0.tgz", | ||||||
|       "integrity": "sha512-bAfE5Pp+qqHiz4GkpH64HqHUgK2DippKB3QuYbsOp8QoR8c7S646jJMfsOj+WHZO5dPssO3j+54LwG3w3HeYWg==", |       "integrity": "sha512-kVF+eIDzPPwPcJdoVhWboJvdCe+YF1+rkd7+LeYmA95179T0sVB5kKG8VADM/3sBnGWeAUBR8FzH+whlksJTrQ==", | ||||||
|       "requires": { |       "requires": { | ||||||
|         "semver": "^7.3.5" |         "semver": "^7.3.5" | ||||||
|       } |       } | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ | |||||||
|     "helmet": "4.6.0", |     "helmet": "4.6.0", | ||||||
|     "html": "1.0.0", |     "html": "1.0.0", | ||||||
|     "html2plaintext": "2.1.2", |     "html2plaintext": "2.1.2", | ||||||
|     "http-proxy-agent": "4.0.1", |     "http-proxy-agent": "5.0.0", | ||||||
|     "https-proxy-agent": "5.0.0", |     "https-proxy-agent": "5.0.0", | ||||||
|     "image-type": "4.1.0", |     "image-type": "4.1.0", | ||||||
|     "ini": "2.0.0", |     "ini": "2.0.0", | ||||||
| @@ -59,7 +59,7 @@ | |||||||
|     "jsdom": "17.0.0", |     "jsdom": "17.0.0", | ||||||
|     "mime-types": "2.1.32", |     "mime-types": "2.1.32", | ||||||
|     "multer": "1.4.3", |     "multer": "1.4.3", | ||||||
|     "node-abi": "3.0.0", |     "node-abi": "3.1.0", | ||||||
|     "open": "8.2.1", |     "open": "8.2.1", | ||||||
|     "portscanner": "2.2.0", |     "portscanner": "2.2.0", | ||||||
|     "rand-token": "1.0.1", |     "rand-token": "1.0.1", | ||||||
|   | |||||||
| @@ -233,8 +233,6 @@ class Note extends AbstractEntity { | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         console.log("POJO update", pojo); |  | ||||||
|  |  | ||||||
|         sql.upsert("note_contents", "noteId", pojo); |         sql.upsert("note_contents", "noteId", pojo); | ||||||
|  |  | ||||||
|         const hash = utils.hash(this.noteId + "|" + pojo.content.toString()); |         const hash = utils.hash(this.noteId + "|" + pojo.content.toString()); | ||||||
|   | |||||||
| @@ -174,7 +174,7 @@ class Froca { | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         const searchResultNoteIds = await server.get('special-notes/search-note/' + note.noteId); |         const searchResultNoteIds = await server.get('search-note/' + note.noteId); | ||||||
|  |  | ||||||
|         if (!Array.isArray(searchResultNoteIds)) { |         if (!Array.isArray(searchResultNoteIds)) { | ||||||
|             throw new Error(`Search note ${note.noteId} failed: ${searchResultNoteIds}`); |             throw new Error(`Search note ${note.noteId} failed: ${searchResultNoteIds}`); | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ const build = require('./build'); | |||||||
| const packageJson = require('../../package'); | const packageJson = require('../../package'); | ||||||
| const {TRILIUM_DATA_DIR} = require('./data_dir'); | const {TRILIUM_DATA_DIR} = require('./data_dir'); | ||||||
|  |  | ||||||
| const APP_DB_VERSION = 183; | const APP_DB_VERSION = 184; | ||||||
| const SYNC_VERSION = 21; | const SYNC_VERSION = 21; | ||||||
| const CLIPPER_PROTOCOL_VERSION = "1.0"; | const CLIPPER_PROTOCOL_VERSION = "1.0"; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -32,7 +32,14 @@ async function migrate() { | |||||||
|     // backup before attempting migration |     // backup before attempting migration | ||||||
|     await backupService.backupNow("before-migration"); |     await backupService.backupNow("before-migration"); | ||||||
|  |  | ||||||
|     const currentDbVersion = parseInt(optionService.getOption('dbVersion')); |     const currentDbVersion = getDbVersion(); | ||||||
|  |  | ||||||
|  |     if (currentDbVersion < 183) { | ||||||
|  |         log.error("Direct migration from your current version is not supported. Please upgrade to the latest v0.47.X first and only then to this version."); | ||||||
|  |  | ||||||
|  |         utils.crash(); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     fs.readdirSync(resourceDir.MIGRATIONS_DIR).forEach(file => { |     fs.readdirSync(resourceDir.MIGRATIONS_DIR).forEach(file => { | ||||||
|         const match = file.match(/([0-9]{4})__([a-zA-Z0-9_ ]+)\.(sql|js)/); |         const match = file.match(/([0-9]{4})__([a-zA-Z0-9_ ]+)\.(sql|js)/); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user