Hi, I'm trying the TW/Migrate combination for an import and am receiving the following error when I add a Content Set:
Could not analyze migrate_map_CC_Export (connection default)
Could not analyze migrate_msgs_CC_Export (connection default)
The tables are both present in tw_tables:
migrate_msgs_CC_Export default 0 migrate_msgs_CC_Export
migrate_map_CC_Export default 0 migrate_map_CC_Export
The name of the table/view I'm importing is CC_Export.
Ignoring the error (usually not a good idea) and performing a drush import gives this response:
chp-d617 515 $ drush migrate-import 1 --feedback="30 seconds"
The drush command hook naming conventions have changed; the function [error]
drush_migrate_migrate_import must be renamed to drush_migrate_import. The old function
will be called, but this will be removed shortly.
Importing content set 'Basic import' [notice]
WD php: Table 'chp-new.migrate_map_CC_Export' doesn't exist [error]
query: SELECT cc_export.Email_Address AS Email_Address,
...
FROM cc_export cc_export
LEFT JOIN migrate_map_CC_Export migrate_map_CC_Export ON cc_export.Email_Address =
migrate_map_CC_Export.sourceid
LEFT JOIN migrate_msgs_CC_Export migrate_msgs_CC_Export ON cc_export.Email_Address =
migrate_msgs_CC_Export.sourceid
WHERE (migrate_map_CC_Export.sourceid IS NULL OR migrate_map_CC_Export.needs_update =
1) AND (migrate_msgs_CC_Export.sourceid IS NULL)
in
/Users/aangel/LocalDevelopment/htdocs/chp-d617/sites/all/modules/migrate/migrate.module
on line 719.
which is probably to be expected.
Could it have anything to do with this error in TW that I discovered last night?
Invisible Primary Key
http://drupal.org/node/869144
Move the question to the TW queue? I'm asking here first because Migrate depends on TW and it's probably best to know first what its trying to do when the error occurs.
Thanks,
-André
Comments
Comment #1
aangel CreditAttribution: aangel commentedAha, just thought to check the log and found:
Tracing it back, it looks like Table Wizard imported my raw csv file and used LONGTEXT from the primary key. When creating the migrate_msgs_* table, Schema uses the same column type, which requires a key length be specified for the index.
Going back to the original table (CC_Export) and changing the LONGTEXT to VARCHAR resolved the problem.
I don't know why TW selected LONGTEXT for my primary key/first field but hopefully this helps someone else.
Comment #2
mikeryanThe map table key is the same type as the source table key (since it has to hold the same values). When Table Wizard imports a file, it doesn't know what type each column should be, so it defaults to text fields for maximum generality. It also displays a message alerting you that it has done this: