Skip to content

Build your personal knowledge base with Trilium Notes

fix(server): imports in migration not working

Elian Doran05a61ebd2976
diff --git a/apps/server/src/assets/db/migrations/0216__move_content_into_blobs.ts b/apps/server/src/assets/db/migrations/0216__move_content_into_blobs.ts
index c10fcc7801..6251e70aa3 100644
--- a/apps/server/src/assets/db/migrations/0216__move_content_into_blobs.ts
+++ b/apps/server/src/assets/db/migrations/0216__move_content_into_blobs.ts
@@ -1,5 +1,5 @@
-import sql from "../../src/services/sql";
-import utils from "../../src/services/utils";
+import sql from "../../../services/sql.js";
+import utils from "../../../services/utils.js";
interface NoteContentsRow {
noteId: string;
diff --git a/apps/server/src/assets/db/migrations/0220__migrate_images_to_attachments.ts b/apps/server/src/assets/db/migrations/0220__migrate_images_to_attachments.ts
index f54f4a9563..1972462732 100644
--- a/apps/server/src/assets/db/migrations/0220__migrate_images_to_attachments.ts
+++ b/apps/server/src/assets/db/migrations/0220__migrate_images_to_attachments.ts
@@ -1,8 +1,8 @@
-import becca from "../../src/becca/becca";
-import becca_loader from "../../src/becca/becca_loader";
-import cls from "../../src/services/cls";
-import log from "../../src/services/log";
-import sql from "../../src/services/sql";
+import becca from "../../../becca/becca.js";
+import becca_loader from "../../../becca/becca_loader.js";
+import cls from "../../../services/cls.js";
+import log from "../../../services/log.js";
+import sql from "../../../services/sql.js";
export default () => {
cls.init(() => {
@@ -18,7 +18,7 @@ export default () => {
if (attachment) {
log.info(`Auto-converted note '${note.noteId}' into attachment '${attachment.attachmentId}'.`);
}
- } catch (e) {
+ } catch (e: any) {
log.error(`Cannot convert note '${note.noteId}' to attachment: ${e.message} ${e.stack}`);
}
}