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

Implement a --dry-run option #1

Closed
wants to merge 1 commit into from
Closed

Conversation

elazar
Copy link

@elazar elazar commented Nov 24, 2015

DO NOT MERGE. This PR is intended only for internal peer review prior to submitting the changes upstream, assuming we do eventually decide to do so.

A few things I don't like about the current implementation, but have yet to find a way to work around:

  • Manipulating the verbosity level of the OutputInterface instance in various areas. The core has its own output surrounding each migration that's difficult to reliably differentiate from dry run output. Because the core output would make copying and pasting the output of a dry run a lot more troublesome, the current approach simply changes the output verbosity level to squelch the core output.
  • Coupling ReadOnlyProxyStatement to OutputInterface. The alternative is to duplicate the code to manipulate output verbosity levels in DryRunAdapter, which would require overriding most if not all of the methods of AdapterWrapper to be able to call that code.
  • Coupling ReadOnlyProxyConnection to OutputInterface. This is the best way I've found to make this interoperable with the rest of the core while still supporting the output of generated SQL statements.

Refs cakephp#567

* Phinx
*
* (The MIT license)
* Copyright (c) 2015 Rob Morgan

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assigning the copyright, or should it be you?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Far as I can tell, this is what's done in the files you've contributed, so I just followed suit.

@shadowhand
Copy link

Alright, let's keep this approach for now.

@elazar
Copy link
Author

elazar commented Nov 30, 2015

@shadowhand Should we just point wheniwork-db to this fork, or should we try to submit this upstream?

@shadowhand
Copy link

@elazar for now let's point at this fork. I'd like to try a cleaner injection before we submit upstream.

@laytoneverson
Copy link

This is an important feature. +1

@ghost ghost mentioned this pull request Jan 12, 2016
@elazar
Copy link
Author

elazar commented Jul 8, 2016

Potentially relevant: looks like there's an open PR for this upstream, cakephp#746. The approach seems to be similar to the way I did it.

@elazar
Copy link
Author

elazar commented Sep 8, 2018

This was implemented in cakephp#1127.

@elazar elazar closed this Sep 8, 2018
@elazar elazar deleted the feature/dry-run-option branch September 8, 2018 00:58
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.

3 participants