New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create migrations with the CLI without knexfile #2819
Comments
Why do you need that? Currently big problem with command line client is that it really doesn't have any tests. So until someone writes some test setup for running tests for it we have not been accepting any additions to that part of knex. |
Some projects don't have knexfile in the first place and only pass config to knex instance programmatically. I've seen projects with fictitious knexfile just for generating migrations. |
Sure, this is not the first time that something like this has been requested. |
Allows to create and run migrations. closes knex#2819
* Migrations with CLI and without knexfile Allows to create and run migrations. closes #2819 * Apply tweaks to migrate without knexfile Thanks to @kibertoad comments! The bigger change was to remove the bash script to test knex's cli command, and replace it with a jake file. I believe this jake file may be used as a base for future cli tests. * Replace `fs.promises` with `new Promise`
Thank you so much ! |
* Migrations with CLI and without knexfile Allows to create and run migrations. closes knex#2819 * Apply tweaks to migrate without knexfile Thanks to @kibertoad comments! The bigger change was to remove the bash script to test knex's cli command, and replace it with a jake file. I believe this jake file may be used as a base for future cli tests. * Replace `fs.promises` with `new Promise`
Feature discussion / request
It would be convenient to be able to create migrations without knexfile, one could pass the required arguments to the CLI.
In my case only
client
ordialect
is necessary but one can also imagine passing the directory of the migrations or other by the arguments.The text was updated successfully, but these errors were encountered: