Skip to content

Commit

Permalink
Update umzug.mjs (#509)
Browse files Browse the repository at this point in the history
Fixed typos
  • Loading branch information
cellulosa authored Sep 22, 2021
1 parent f7d4692 commit e739e1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/2.es-modules/umzug.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ const sequelize = new Sequelize({

export const migrator = new Umzug({
migrations: {
glob: ['migrations/*.{js,cjs,mjs}', { cwd: path.dirname(import.meta.url.replace('file:///', '')) }],
glob: ['migrations/*.{js,cjs,mjs}', { cwd: path.dirname(import.meta.url.replace('file://', '')) }],
resolve: params => {
if (params.path.endsWith('.mjs') || params.path.endsWith('.js')) {
const getModule = () => import(`file:///${params.path.replace(/\\/g, '/')}`)
return {
name: params.name,
path: params.path,
up: async upParams => (await getModule()).up(upParams),
down: async downParams => (await getModule()).up(downParams),
down: async downParams => (await getModule()).down(downParams),
}
}
return {
Expand Down

0 comments on commit e739e1f

Please sign in to comment.