function drush_policy_sql_sync_validate

8.0.x policy.drush.inc drush_policy_sql_sync_validate($source = NULL, $destination = NULL)
6.x policy.drush.inc drush_policy_sql_sync_validate($source = NULL, $destination = NULL)
7.x policy.drush.inc drush_policy_sql_sync_validate($source = NULL, $destination = NULL)
4.x policy.drush.inc drush_policy_sql_sync_validate($source = NULL, $destination = NULL)
5.x policy.drush.inc drush_policy_sql_sync_validate($source = NULL, $destination = NULL)
master policy.drush.inc drush_policy_sql_sync_validate($source = NULL, $destination = NULL)

Implements drush_hook_COMMAND_validate().

Prevent catastrophic braino. Note that this file has to be local to the machine that intitiates sql-sync command.

File

examples/policy.drush.inc, line 26
Example policy commandfile. Modify as desired.

Code

function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
  if ($destination == '@prod') {
    return drush_set_error('POLICY_DENY', dt('Per examples/policy.drush.inc, you may never overwrite the production database.'));
  }
}