mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	feat(docs): preserve note IDs
This commit is contained in:
		
							parent
							
								
									b6137c0747
								
							
						
					
					
						commit
						8c6dbb4446
					
				| @ -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,
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran