question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to move up or down a set number of migrations

See original GitHub issue

When testing and debugging migrations, I often want to apply migrations one-at-a-time, checking the changes made by each one. Currently, this requires finding and typing out the timestamp for each migration.

An option like this would simplify this workflow:

$ knex-migrate up --number 1
$ knex-migrate down -n 1

Alternatively, to support just the more common use case of a single migration at a time:

$ knex-migrate up --one
$ knex-migrate down -1

Happy to send in a PR if you think this would be useful.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kylealwyncommented, Dec 18, 2017

suggesting --count

0reactions
sheeruncommented, Dec 20, 2017

Implemented and released

Read more comments on GitHub >

github_iconTop Results From Across the Web

Commands - db-migrate - Read the Docs
The down command executes the migrations of your currently configured migrations directory. More specific the down migrations are being called. Down migrations ......
Read more >
Code-Based Migration in Entity Framework 6
Add -Migration: Creates a new migration class as per specified name with the Up() and Down() methods. Update-Database: Executes the last migration file ......
Read more >
Database: Migrations - The PHP Framework For Web Artisans
A migration class contains two methods: up and down . The up method is used to add new tables, columns, or indexes to...
Read more >
Migration Strategies - Types & Best Practices
Create the entire folder hierarchy on the destination, based on what is defined at the source. Migrate only up to 10 items in...
Read more >
Writing Migrations - 3.10 - CakePHP Cookbook
When executing this migration, Phinx will create the user_logins table on the way up and ... returns the result as an array }...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found