Pass an argument to knex.migrate.latest()
See original GitHub issueI’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 makethis.config
available? - Is there another option I’m missing?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:7 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Isnt it visible in
knex.client.config
either?Fixed by #2802