function webform_drush_sql_sync_sanitize in Webform 6.x
Same name and namespace in other branches
- 8.5 drush/webform.drush.hooks.inc \webform_drush_sql_sync_sanitize()
- 7.4 webform.drush.inc \webform_drush_sql_sync_sanitize()
Implements hook_drush_sql_sync_sanitize().
See also
sql_drush_sql_sync_sanitize()
\Drush\Commands\core\SanitizeCommands::sanitizeSessions
File
- drush/
webform.drush.hooks.inc, line 14 - Drush 8 hooks.
Code
function webform_drush_sql_sync_sanitize($site) {
$wrap_table_name = drush_get_option('db-prefix');
$tables = array_intersect([
'webform_submission',
'webform_submission_data',
'webform_submission_log',
], drush_sql_get_class()
->listTables());
$query = [];
foreach ($tables as $table) {
if ($wrap_table_name) {
$table = "{{$table}}";
}
$query[] = 'TRUNCATE ' . $table . ';';
}
drush_sql_register_post_sync_op('webform_submission', dt('Truncate webform submission tables.'), implode(' ', $query));
}