Sequelize-cli makes it very easy to create and run migrations. It also keeps track of migrations you have run so only new migrations are processed when you run the migrations again.
But sometimes, for any reason, you may want to run a specific migration. How do you do that?
I had the same case and wanted to run a specific migration but could not find anything on the documentation.
So I ran the following command to get some help.
sequelize-cli db:migrate --help
Turns out I can pass the some arguments to create a range of migrations I want to run.
--to // Migration name to run migrations until --from // Migration name to start migrations from (excluding)
I tried passing the arguments but it did not work so I decided to see the source code. Apparently, it needs the filename instead of the migration name. I ran again and was successful.
npx sequelize-cli db:migrate --from will-not-be-included.js --to filename.js
I have also posted this on a Stack overflow question here.