mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	feat(docs): preserve note IDs
This commit is contained in:
		| @@ -8,7 +8,7 @@ export async function initializeDatabase() { | |||||||
|  |  | ||||||
|     cls.init(() => { |     cls.init(() => { | ||||||
|         if (!sqlInit.isDbInitialized()) { |         if (!sqlInit.isDbInitialized()) { | ||||||
|             sqlInit.createInitialDatabase(); |             sqlInit.createInitialDatabase(true); | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -64,7 +64,7 @@ async function initDbConnection() { | |||||||
|     dbReady.resolve(); |     dbReady.resolve(); | ||||||
| } | } | ||||||
|  |  | ||||||
| async function createInitialDatabase() { | async function createInitialDatabase(preserveIds?: boolean) { | ||||||
|     if (isDbInitialized()) { |     if (isDbInitialized()) { | ||||||
|         throw new Error("DB is already initialized"); |         throw new Error("DB is already initialized"); | ||||||
|     } |     } | ||||||
| @@ -112,7 +112,9 @@ async function createInitialDatabase() { | |||||||
|  |  | ||||||
|     const dummyTaskContext = new TaskContext("no-progress-reporting", "import", false); |     const dummyTaskContext = new TaskContext("no-progress-reporting", "import", false); | ||||||
|  |  | ||||||
|     await zipImportService.importZip(dummyTaskContext, demoFile, rootNote); |     await zipImportService.importZip(dummyTaskContext, demoFile, rootNote, { | ||||||
|  |         preserveIds | ||||||
|  |     }); | ||||||
|  |  | ||||||
|     sql.transactional(() => { |     sql.transactional(() => { | ||||||
|         // this needs to happen after ZIP import, |         // this needs to happen after ZIP import, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user