Knex: Rollback specific migration?
From the doc:
To undo the specified migration that was run
$ knex migrate:down 001_migration_name.js
To run the specified migration that has not yet been run
$ knex migrate:up 001_migration_name.js
To list both completed and pending migrations:
$ knex migrate:list
(to list and check)
(migrate:list
was released in 0.19.3! if not available update knex (npm i -g knex
))
Update: This answer is now out of date - the functionality was since implemented in knex as stated by mcating comment and by Mohamed in this answer
At this point of time this is not possible - you can find the discussion of this feature in this GitHub ticket: #666
You can use knex-migrate which is a migration toolkit for knex and supports the --only
flag for rollbacks.