Feature request - apply singular migrations
I just started using sequelize cli, having moved over from using PHP migrations. I was surprised to find that it doesn't seem possible to apply/undo a single migration file at a time. I've worked this way when using PHP based migrations and I find it a lot easier to work this way than having to do/undo all migrations or specify a named migrations to be done next.
Is there any plans to include this as a feature? Thanks.
It already exists. Keep in mind migrations are timestamped and thus run in a particular order. Knowing this you can use:
sequelize db:migrate --from <migration name> --to <migration name>
and list --from [desired migration -1] --to [desired migration]
(note: --from is exclusive while --to is inclusive).
To undo:
sequelize db:migrate:undo --name <migration name>
If you want to see these for yourself, you can run:
sequelize db:migrate --help and sequelize db:migrate:undo --help
Thanks for your reply. However, I am not sure that answers the issue. I think it would be useful if there wasn't a need for naming the migration. For example, the Yii2 framework has these options: -
yii migrate/up 1
yii migrate/down 1
I find that a lot easier to work with.
Any news on if this will be incorporated as a feature? It would be very handy indeed. I am still running Yii2 PHP migrations, would like to switch over to sequelize CLI but I would really like to have this feature available for ease of use when creating, modifying and testing a new migration. Thanks.