Skip to content
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

Merged
merged 8 commits into from
Jul 24, 2017
Merged

Add dump option #1127

merged 8 commits into from
Jul 24, 2017

Conversation

kerneldemon
Copy link
Contributor

Hey,

I'd like a way to dump plain sql using the phinx migrate and phinx 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.

@@ -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')
Copy link
Member

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?

@lorenzo
Copy link
Member

lorenzo commented Jul 23, 2017

I'm not sure this solution is actually going to work for all cases, but it is a good start.

@kerneldemon
Copy link
Contributor Author

@lorenzo the name dry-run sounds about right

@lorenzo
Copy link
Member

lorenzo commented Jul 24, 2017

Thanks @kerneldemon! Would you mind adding a brief explanation of this new flag to the docs?

@kerneldemon
Copy link
Contributor Author

@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.

@lorenzo
Copy link
Member

lorenzo commented Jul 24, 2017

@kerneldemon duplicating the test sounds good

@kerneldemon
Copy link
Contributor Author

@lorenzo Moved the text slightly. Is anything else missing?

@lorenzo
Copy link
Member

lorenzo commented Jul 24, 2017

Thanks for the contribution!

@lorenzo lorenzo merged commit 93fd92b into cakephp:master Jul 24, 2017
This was referenced Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants