mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	fix(server): migration not working
This commit is contained in:
		
							parent
							
								
									729ea1d2bc
								
							
						
					
					
						commit
						d74b8e65bd
					
				| @ -7,6 +7,7 @@ import resourceDir from "./resource_dir.js"; | |||||||
| import appInfo from "./app_info.js"; | import appInfo from "./app_info.js"; | ||||||
| import cls from "./cls.js"; | import cls from "./cls.js"; | ||||||
| import { t } from "i18next"; | import { t } from "i18next"; | ||||||
|  | import { join } from "path"; | ||||||
| 
 | 
 | ||||||
| interface MigrationInfo { | interface MigrationInfo { | ||||||
|     dbVersion: number; |     dbVersion: number; | ||||||
| @ -99,7 +100,7 @@ async function prepareMigrations(currentDbVersion: number): Promise<MigrationInf | |||||||
|                 // Due to ESM imports, the migration file needs to be imported asynchronously and thus cannot be loaded at migration time (since migration is not asynchronous).
 |                 // Due to ESM imports, the migration file needs to be imported asynchronously and thus cannot be loaded at migration time (since migration is not asynchronous).
 | ||||||
|                 // As such we have to preload the ESM.
 |                 // As such we have to preload the ESM.
 | ||||||
|                 // Going back to the original approach but making it webpack-compatible
 |                 // Going back to the original approach but making it webpack-compatible
 | ||||||
|                 const importPath = `../../db/migrations/${file}`; |                 const importPath = join(resourceDir.MIGRATIONS_DIR, file); | ||||||
|                 migration.module = (await import(importPath)).default; |                 migration.module = (await import(importPath)).default; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran