You are here

function migrate_update_7207 in Migrate 7.2

Make sure we remove an empty 'default' group created by the previous updates.

File

./migrate.install, line 560
Migrate module installation

Code

function migrate_update_7207() {
  $rows = db_select('migrate_group', 'mg')
    ->fields('mg', array(
    'name',
  ))
    ->condition('name', 'default')
    ->execute()
    ->rowCount();
  if ($rows > 0) {
    $rows = db_select('migrate_status', 'ms')
      ->fields('ms', array(
      'machine_name',
    ))
      ->condition('group_name', 'default')
      ->execute()
      ->rowCount();
    if ($rows == 0) {
      db_delete('migrate_group')
        ->condition('name', 'default')
        ->execute();
    }
  }
}