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