-
-
Notifications
You must be signed in to change notification settings - Fork 162
Closed
Description
I decided to go mjs
way instead of type: module
, but umzug can't handle these files atm.
require doesn't work with esm so then maybe it would be nice to make resolver async so I can handle these files with dynamic import.
Now I made it work like this:
resolve: ({ name, path, context }) => {
return {
// adjust the parameters Umzug will
// pass to migration methods when called
name,
up: async () => {
const { up } = await import(path);
return up({ context });
},
down: async () => {
const { down } = await import(path);
return down({ context });
},
};
},
Thanks
Metadata
Metadata
Assignees
Labels
No labels