Index: migrate.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/migrate/migrate.module,v
retrieving revision 1.1.2.62
diff -u -p -r1.1.2.62 migrate.module
--- migrate.module	19 Sep 2009 16:23:57 -0000	1.1.2.62
+++ migrate.module	17 Dec 2009 02:08:43 -0000
@@ -142,11 +145,8 @@ function migrate_save_content_set(&$cont
     }
     $tablename = $view->base_table;
   }
-
-  db_set_active($tabledb);
-  $inspect = schema_invoke('inspect');
-  db_set_active('default');
-  $sourceschema = $inspect[$tablename];
+  $sourceschema = tw_inspect_schema($tablename, $tabledb);
   // If the PK of the content set is defined, make sure we have a mapping table
   if (isset($content_set->sourcekey) && $content_set->sourcekey) {
     $sourcefield = $sourceschema['fields'][$content_set->sourcekey];
@@ -1084,10 +1086,8 @@ function migrate_schema_alter(&$schema) 
         $tabledb = 'default';
       }
       $tablename = $view->base_table;
-      db_set_active($tabledb);
-      $inspect = schema_invoke('inspect');
-      db_set_active('default');
-      $sourceschema = $inspect[$tablename];
+      $sourceschema = tw_inspect_schema($tablename, $tabledb);
       // If the PK of the content set is defined, make sure we have a mapping table
       if ($sourcekey = $content_set->sourcekey) {
         $sourcefield = $sourceschema['fields'][$sourcekey];
