There are a lot of posts on sequelize migration file access through the sequilize-cli file structure. However, if I am not using the sequilize-cli, how does one locate the migration file?
Well, in order to work with migrations and run them, you will need to use sequelize-cli
, you can run the command sequelize init
which will initialize the folders/files needed to work with the cli.
However, you can ignore that step by using your own structure and creating a file named .sequelizerc
where you will place your migrations/seeds, for example mine looks like the folowing:
const path = require('path')
module.exports = {
'config': path.resolve('config', 'db.json'),
'migrations-path': path.resolve('db', 'migrate'),
'seeders-path': path.resolve('db', 'seeders')
}
So if I run sequelize db:migrate
the cli will automatically look for the migrations in the db/migrate folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With