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.

Pass an argument to knex.migrate.latest()

See original GitHub issue

I’m running Knex migrations programmatically and I’d like to pass an argument to knex.migrate.latest({}) at runtime. I see that the configurable object passed to #latest() gets merged into the migration configuration, but this configuration does not seem to be available from within an up/down function.

  • Can we pass the config as an extra argument to up/down?
  • Can we bind up/down to the migration’s this at call time to make this.config available?
  • Is there another option I’m missing?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
elhigucommented, Aug 29, 2018

Isnt it visible in knex.client.config either?

0reactions
elhigucommented, Sep 29, 2018

Fixed by #2802

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass an argument to knex.migrate.latest() · Issue #2014 - GitHub
I'm running Knex migrations programmatically and I'd like to pass an argument to knex.migrate.latest({}) at runtime.
Read more >
Migrations | Knex.js
Rolls back the latest migration group. If the all parameter is truthy, all applied migrations will be rolled back instead of just the...
Read more >
Is the Promise argument passed into Knex migrations needed?
After I created my schema I noticed that I never used the Promise argument, provided by default (my code below).
Read more >
Database Migrations with Knex - Perk
Learn how to migrate your Postgres database. ... To create a new migration simply use the knex cli: ... Certain column types take...
Read more >
Migrations in Knex - DEV Community ‍ ‍
How to create and apply migrations with Knex.js. ... Like the name says, createTable() is a function that creates a new database table....
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