/** * Sql-sync sanitization example. This is equivalent to * the built-in --sanitize option of sql-sync, but simplified * to only work with default values on Drupal 6 + mysql. * * @see sql_drush_sql_sync_sanitize(). */ function hook_drush_sql_sync_sanitize($source) { drush_sql_register_post_sync_op('my-sanitize-id', dt('Reset passwords and email addresses in user table'), "update users set pass = MD5('password'), mail = concat('user+', uid, '@localhost') where uid > 0;"); }
/** * Sql-sync sanitization example. * * This is equivalent to the built-in --sanitize option of sql-sync, but * simplified to only work with default values on Drupal 6 + mysql. * * @see sql_drush_sql_sync_sanitize() */ function hook_drush_sql_sync_sanitize($source) { $table = drush_get_option('db-prefix') ? '{users}' : 'users'; drush_sql_register_post_sync_op('my-sanitize-id', dt('Reset passwords and email addresses in user table.'), "UPDATE {$table} SET pass = MD5('password'), mail = concat('user+', uid, '@localhost') WHERE uid > 0;"); }