-
Hello, I'm using .
├── build
├── db
│ └── database.sqlite3
├── package-lock.json
├── package.json
└── src
├── index.js
├── migrations
│ ├── 20200628183646-create-config.js
│ ├── 20200628183704-create-model.js
│ ├── 20200628183814-create-feature.js
│ ├── 20200628183850-create-features-to-config.js
│ ├── 20200628183909-create-models-to-config.js
│ ├── 20200904133751-create-user.js
│ ├── 20200925132248-create-setting.js
│ └── 20201008143604-create-label.js
└── models
├── config.js
├── feature.js
├── featureToConfig.js
├── index.js
├── label.js
├── model.js
├── modelToConfig.js
├── setting.js
└── user.js I'm building the sources with Now, I'm wondering why creating // Create Umzug instance.
const umzug = new Umzug({
migrations: { glob: './migrations/*.js' },
context: db.sequelize.getQueryInterface(),
storage: new SequelizeStorage({ sequelize: db.sequelize }),
logger: console
}); makes it unable to find pending migrations. If I change the It seems like prepending glob path with I'm using
It seems like they're run "out of the scope". In both scenarios from above copying I was able to achieve my goal by manually importing all migration files and using the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I haven't used One thing that might be worth trying from eyeballing your project tree. Instead of explicitly making glob const umzug = new Umzug({
- migrations: { glob: './migrations/*.js' },
+ migrations: { glob: ['./migrations/*.js', { cwd: __dirname }] },
context: db.sequelize.getQueryInterface(),
storage: new SequelizeStorage({ sequelize: db.sequelize }),
logger: console
}); Then when you generated a bundle, put the Also worth looking at: seems like Possibly adding the migrations to If you can create a small repro of this issue (git repo I can clone, install, build, run and see the error on) I can take a look, and maybe add an example to the examples folder, or see if there's anything that could be added to umzug to make this easier. |
Beta Was this translation helpful? Give feedback.
-
@sowizz There's now an example of one way that you can workaround the issue of bundlers wiping out the filesystem structure by using codegen to reduce the overhead of manually maintaining an array of migrations: https://github.com/sequelize/umzug/tree/master/examples/7.bundling-codegen. It uses |
Beta Was this translation helpful? Give feedback.
@sowizz There's now an example of one way that you can workaround the issue of bundlers wiping out the filesystem structure by using codegen to reduce the overhead of manually maintaining an array of migrations: https://github.com/sequelize/umzug/tree/master/examples/7.bundling-codegen. It uses
parcel
rather thanpkg
but the principle is the same.