In my last patch (http://drupal.org/node/438828), I forgot to support --structure-tables-key (just missed a block of code). This patch rectifies that oversight. It also fixes the verbose flag (now passes '-q' for quiet and nothing for verbose) and [bonus feature] adds a new command "drush sql tables" that lists all tables in the database. Finally, a check is also added to prevent attempts to copy a Postgres database into a Mysql database (or visa-versa) via "drush sql load".

- Greg

Comments

moshe weitzman’s picture

Status: Needs review » Needs work

Thanks.

I don't really like multi-purpose patches though. Can we just add structure-tables support? I'll also take our -q change if you think it makes sense. Note that drush already has -q support so maybe we should expect user to specify that.

sql tables might make sense if we add your smart merging. i have to look into that. until we do, lets expect admins to use sql query command.

that check for scheme in sql load is too defensive IMO. it will save one user in a million. not worth the extra code.

greg.1.anderson’s picture

StatusFileSize
new5.33 KB

I have included a new patch that is identical to the previous, but backs out the "drush sql tables" command and the schema check in "drush sql load". I'll resubmit the tables command when merging is working, and you can decide then whether that belongs in "drush sql" (my preference) or in a separate drush module. I backed out the schema check with some reluctance; it's only three lines of code, and in my mind the code is more correct with the check.

I think that the -q change makes sense the way I put it in; mysql is quiet by default and verbose with -v, whereas psql is verbose by default and quiet with -q. The way I patched it normalizes the verbosity levels between mysql and drush.

Let me know if you want further modifications. (Point of procedure: do you want me to set the status back to "needs review" every time I submit a patch that I think might be "done"? I've been leaving the status alone after you touch it.)

Thanks,

- Greg

moshe weitzman’s picture

Status: Needs work » Fixed

Committed. Thanks.

You should set status back to 'needs review' every time. Some other relevant questions are documented at http://drupal.org/patch.

moshe weitzman’s picture

One more thing - when you create patch, it should be from within the relevant contrib module at its root dir. So yours should be one level deeper. Thanks.

greg.1.anderson’s picture

Great, thanks. I'll adjust my makepatch script appropriately.

greg.1.anderson’s picture

Title: Support for --structure-tables-key in Postgres » [Committed] Support for --structure-tables-key in Postgres

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.