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.

Error when trying to rollback a migration

See original GitHub issue

Environment

Knex version: 0.19.2 Database + version: PostgreSQL 11 OS: macOS Mojave 10.14.6

Bug

  1. Explain what kind of behaviour you are getting and how you think it should do Following the steps excatly provided in http://perkframework.com/v1/guides/database-migrations-knex.html I successfully create and run a migration. However, when trying to knex migrate:rollback, I get an error unless I prefix the command with npx.

  2. Error message

.spread((batchNo, log) => {
         ^

TypeError: initKnex(...).migrate.rollback(...).spread is not a function

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
angela-mylocommented, Sep 18, 2019

I was getting the same error, but was able to resolve it by upgrading my global reference of knex to the latest version: npm install -g knex

5reactions
hades2510commented, Oct 8, 2019

You may try running npx knex migrate:rollback. This should run the latest version of knex CLI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

php artisan migrate:rollback error - Laracasts
Hello, when i typed command php artisan migrate:rollback i got error, that class does not exist. But it is existing. Copy Code
Read more >
Laravel 5.2 php artisan migrate:rollback error - Stack Overflow
I use Laravel 5.2 and I created database tables by running php artisan make:migration create_categories_table --create= ...
Read more >
Troubleshooting: Migration Rollback Failed - VMware Docs
For various reasons, your migration rollback might fail. If it fails, perform these troubleshooting steps.
Read more >
Roll back error during SfB user migration to Teams
During migration to Teams I had a error message "An unknown error occurred while trying to roll back the user". Read more how...
Read more >
Active Record Migrations - Rails Edge Guides
If your migration is irreversible, you should raise ActiveRecord::IrreversibleMigration from your down method. If someone tries to revert your migration, an ...
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