-
Notifications
You must be signed in to change notification settings - Fork 893
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
Add dump option #1127
Add dump option #1127
Conversation
@@ -47,6 +47,7 @@ protected function configure() | |||
->setDescription('Migrate the database') | |||
->addOption('--target', '-t', InputOption::VALUE_REQUIRED, 'The version number to migrate to') | |||
->addOption('--date', '-d', InputOption::VALUE_REQUIRED, 'The date to migrate to') | |||
->addOption('--dump', '-x', InputOption::VALUE_NONE, 'Dump query to standard output instead of executing 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.
Do you mind renaming this to dry-run
or attempt
?
I'm not sure this solution is actually going to work for all cases, but it is a good start. |
@lorenzo the name |
Thanks @kerneldemon! Would you mind adding a brief explanation of this new flag to the docs? |
@lorenzo I contemplated adding a separate section that would describe the option, but since the option can only be used by two commands, I thought it would be better to just have the same text for migrate and rollback command section. |
@kerneldemon duplicating the test sounds good |
@lorenzo Moved the text slightly. Is anything else missing? |
Thanks for the contribution! |
Hey,
I'd like a way to dump plain sql using the
phinx migrate
andphinx rollback
commands, so I added a--dump
option.This is useful for those who would like to read raw queries before running them in production, there's a discussion about this here.