You are here

function drush_migrate_wipe in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 migrate.drush.inc \drush_migrate_wipe()
  2. 6 migrate.drush.inc \drush_migrate_wipe()

A drush command callback.

File

./migrate.drush.inc, line 1494
Drush support for the migrate module

Code

function drush_migrate_wipe() {
  $types = func_get_args();
  $nids = db_select('node', 'n')
    ->fields('n', array(
    'nid',
  ))
    ->condition('type', $types, 'IN')
    ->execute()
    ->fetchCol();
  $chunks = array_chunk($nids, 50);
  foreach ($chunks as $chunk) {
    node_delete_multiple($chunk);
  }
  migrate_instrument_stop('node_delete');
}