Skip to content

Commit cafc13a

Browse files
authored
fix: migration file cannot be imported (#6616)
1 parent 2b6bff3 commit cafc13a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/payload/src/database/migrations/getPredefinedMigration.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,11 @@ export const getPredefinedMigration = async ({
3131
cleanPath = cleanPath.replaceAll('\\', '/')
3232
const moduleURL = pathToFileURL(cleanPath)
3333
try {
34-
const { downSQL, imports, upSQL } = await eval(`import'${moduleURL.href}')`)
34+
const { downSQL, imports, upSQL } = await eval(`import('${moduleURL.href}')`)
3535
return { downSQL, imports, upSQL }
3636
} catch (error) {
37-
payload.logger.error({
38-
error,
39-
msg: `Error loading predefined migration ${migrationName}`,
40-
})
41-
process.exit(1)
37+
payload.logger.error(`Error loading predefined migration ${migrationName}`)
38+
throw error
4239
}
4340
} else {
4441
payload.logger.error({

0 commit comments

Comments
 (0)