Reputation: 1350
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?
Upvotes: 5
Views: 8243
Reputation: 407
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
Upvotes: 9