Can't find meta/_journal.json file when running migrate

Trying to run migrate() from a lambda function and I can't figure out why it's unable to find the _journal.json file. My structure is in the attached image. In db.ts, I'm calling this migrate function like so:
export const migrateToLatest = async () => {
await migrate(DB, { migrationsFolder: "./migrations" });
};
export const migrateToLatest = async () => {
await migrate(DB, { migrationsFolder: "./migrations" });
};
1 Reply
McLean 25
McLean 25OP2y ago
Error stack:
| Invoked services/functions/db/migrateToLatest.handler
| +145ms [INFO] (alex.MigrateToLatest.migrateToLatest) About to run migrations...
| +161ms [ERROR] (alex.MigrateToLatest.migrateToLatest) Got error trying to migrate to latest
| +161ms {
| +161ms error: Error: Can't find meta/_journal.json file
...
| Invoked services/functions/db/migrateToLatest.handler
| +145ms [INFO] (alex.MigrateToLatest.migrateToLatest) About to run migrations...
| +161ms [ERROR] (alex.MigrateToLatest.migrateToLatest) Got error trying to migrate to latest
| +161ms {
| +161ms error: Error: Can't find meta/_journal.json file
...
Figured it out using relative path from root:
export const migrateToLatest = async () => {
await migrate(DB, { migrationsFolder: "services/core/db/migrations" });
};
export const migrateToLatest = async () => {
await migrate(DB, { migrationsFolder: "services/core/db/migrations" });
};
Want results from more Discord servers?
Add your server