You are here

function migrate_update_6004 in Migrate 6

File

./migrate.install, line 350
Implementation of profile destination handling

Code

function migrate_update_6004() {
  drupal_load('module', 'migrate');
  $ret = array();

  // Need to make sure schema inspect support is included
  schema_init();

  // Make view_name unique
  $sql = "SELECT * FROM {migrate_content_sets}";
  $result = db_query($sql);
  while ($row = db_fetch_object($result)) {

    // Rename map and message tables
    $oldmaptable = $row->view_name . '_map';
    if (db_table_exists($oldmaptable)) {
      $newmaptable = migrate_map_table_name($row->mcsid);
      db_rename_table($ret, $oldmaptable, $newmaptable);

      // Update Table Wizard to reflect the changes
      tw_remove_tables($oldmaptable);
      tw_add_tables($newmaptable);
    }
    $oldmsgtable = $row->view_name . '_msgs';
    if (db_table_exists($oldmsgtable)) {
      $newmsgtable = migrate_message_table_name($row->mcsid);
      db_rename_table($ret, $oldmsgtable, $newmsgtable);

      // Update Table Wizard to reflect the changes
      tw_remove_tables($oldmsgtable);
      tw_add_tables($newmsgtable);
    }
  }
  return $ret;
}