-
Notifications
You must be signed in to change notification settings - Fork 225
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
Added support for environments with dotenv #88
Conversation
@wesleytodd sure, I will check it today, thank you for notifying! |
Works fine! But now I faced with another issue related to this warn message:
I don't think that it's related to this PR, but I haven't seen such problems before (just because I didn't try migrate on Windows, I was previously blocked because I couldn't use So, migration like this not working at all (pool.query is mysql2 function, accepts callback, returns promise): And that failed with not readable error, I see But that case works fine
|
bin/migrate-create
Outdated
@@ -17,10 +18,21 @@ program | |||
.option('-t, --template-file [filePath]', 'Set path to template file to use for new migrations', path.join(__dirname, '..', 'lib', 'template.js')) | |||
.option('-e, --extention [extention]', 'Use the given extention to create the file', '.js') | |||
.option('-g, --generator <name>', 'A template generator function', path.join(__dirname, '..', 'lib', 'template-generator')) | |||
.option('--env <name>', 'Use dotenv to load an environment file') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[name]
?
maybe specify the default ('.env'
) here instead of further down as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for me, I think it would be nice to load default .env
file from project root, even without that option, but keep --env <path>
to specify custom path if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree with that behaviour 👍 that was how I originally imagined as well, as well how db-migrate does it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats actually a mistake. I meant to make a helper for this so that it wasn't a copy paste job. See the other files where it is [name]
. Thanks for catching it.
@alendorff It looks like your EDIT: also of note, this is a breaking change release. So breaks are expected. |
@wesleytodd yes, I know that, that's why I showed examples. I just confused because of two things:
|
Ahh, ok. Sorry for the confusion.
|
Het @alendorff did you figure out how to solve this "if your migration returns a promise, do not call the done callback" problem? Thank you |
@rodgarcialima sorry man, I have no idea what is this all about already 😄 |
Closes #85.
@alendorff Want to check this out?