Skip to content

Instantly share code, notes, and snippets.

@henrikakselsen
Created March 4, 2014 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrikakselsen/9343044 to your computer and use it in GitHub Desktop.
Save henrikakselsen/9343044 to your computer and use it in GitHub Desktop.
<?php
/**
* Implement of drush_hook_COMMAND_validate().
*
* Prevent overwriting your prod db.
* Put this in your ~/.drush folder
*/
function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
if ($destination == '@prod') {
return drush_set_error(dt('Per examples/policy.drush.inc, you may never overwrite the production database.'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment