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

SQL-Sanitize Fails in Drush 9.0.0-beta4 #3013

Closed
mikemadison13 opened this issue Oct 4, 2017 · 3 comments
Closed

SQL-Sanitize Fails in Drush 9.0.0-beta4 #3013

mikemadison13 opened this issue Oct 4, 2017 · 3 comments

Comments

@mikemadison13
Copy link

mikemadison13 commented Oct 4, 2017

After upgrading to 9.0.0-beta4, we are attempting to sanitize databases during syncs.

it would appear that the --sanitize flag was removed in this commit (19543e5#diff-fb2c277772bf5979ffd2cd9676de3c88). Note that it is still listed out here as a flag -- https://drushcommands.com/drush-9x/core/sql-sync/.

The commit message on ^^^ indicates that sql-sanitize is now intended to be run as a separate command and not attached as a flag to sql-sync.

As far as we can tell (see https://github.com/drush-ops/drush/blob/master/src/Drupal/Commands/sql/SanitizeCommands.php) sql-sanitize is still supposed to be a command that functions, however when doing a drush list it doesn't appear in the sql commands, and it doesn't work when running it.

 sql:                                                                                                       
   sql-connect                  A string for connecting to the DB.                                          
   sql-create                   Create a database.                                                          
   sql-drop                     Drop all tables in a given database.                                        
   sql-cli (sqlc)               Open a SQL command-line interface using Drupal's credentials.               
   sql-query (sqlq)             Execute a query against a database.                                         
   sql-dump                     Exports the Drupal DB as SQL using mysqldump or equivalent.                 
   sql-sync                     Copy DB data from a source site to a target site. Transfers data via rsync. 
@weitzman
Copy link
Member

weitzman commented Oct 4, 2017 via email

@mikemadison13
Copy link
Author

interesting, the command does appear when there is a functional site (and does not when there isn't).

thanks for the prompt response!

@greg-1-anderson
Copy link
Member

The new architecture for Drush 9 instantiates Drupal-specific Drush commands via the Drupal services.yml mechanism, from information contained in a drush.services.yml file. This allows Drush commands to participate in Drupal dependency injection.

Because Drupal-specific commands now expect Drupal objects to be injected into them, Drush does not instantiate any of these types of commands unless there is a valid site available.

It is an aspirational goal to instead instantiate a proxy command for all of the Drupal-specific commands, so that they are not completely invisible when inspecting Drush from a non-bootstrapped environment. Running such a proxy command would only print a message advising the user how to select a site, or make their selected site bootstrap-able.

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

No branches or pull requests

3 participants