Document knexfile options
See original GitHub issueCurrently documentation for the knexfile is severely lacking. I wasted a couple of hours trying to configure the directory where migrations are stored, and writing an almost complete bug report before I decided to try some more random things and see if anything would work. As it turns out the way to configure migrations in the knexfile is to use a migrations: {}
object inside the environment object.
I know what you’re thinking: “This guy is stupid! Just reading the default knexfile.js would have saved him all the trouble”.
However I don’t like the idea of having two database configuration files laying around in my project, so early on I converted the default knexfile.js into something that reads my existing database configuration. And anyway, an automatically generated file is not the best documentation medium there is. It would be nice to have the various options with the rest of the documentation.
Issue Analytics
- State:
- Created 9 years ago
- Reactions:8
- Comments:14 (8 by maintainers)
Top GitHub Comments
For those who may still be wondering how to change the migrations directory, use a
knexfile.js
like this:@elhigu please don’t make that claim. Writting “some text” might be easy, but writing decent documentation is a fair amount of work. And writing good documentation is actually quite hard and something most people are not good at, through no fault of their own.
But, if you think it’s easy, then maybe you have experience writing documentation and you’ve gotten good at in. In which case, I’m sure I speak for everyone in this comment thread when I say that I am greatly looking forward to your PR that adds that documentation, or sets up the stubs so that you can work with @tgriesser to refine it into something that benefits everyone who relies on Knex, now or in the future.