Closed (fixed)
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Mar 2011 at 19:06 UTC
Updated:
10 Jul 2013 at 07:21 UTC
Jump to comment: Most recent
Comments
Comment #1
kscheireralso applies to migrate_message_[machinename] table
Comment #2
mikeryanWhat does your call to new MigrateSQLMap in your migration constructor look like? The second argument defines the PK used for the map and message tables, be sure it's set up as a varchar - see this example from BeerTermMigration in migrate_example:
If you enable migrate_example, do its map and message tables get created correctly?
Comment #3
kscheirerThis was my mistake - not being up on the schema API.
I was setting
size => 50instead oflength, which caused some dbtng lookups to fail to handle the field properly. Used correctly, varchars work fine as keys, and indeed are included in the example code. Sorry about that!Comment #5
FrequenceBanane commentedHi,
I'm am very sorry to reopen this thread, but since my problem is the same ...
Even though I have set
I get
Incorrect integer value: 'Festival Label Suisse' for column 'sourceid1' at row 1: INSERT INTO {migrate_message_attsubject} (sourceid1, level, message) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => Festival Label Suisse [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'Festival Label Suisse' for column 'sourceid1' at row 1 ) dans MigrateSQLMap->saveMessage() (ligne 380 dans /var/www/fb2011_2/sites/all/modules/migrate/plugins/sources/sqlmap.inc)Here is my class :
What have I set wrong ? Isn't it supposed to work also with Drupal 7 ?
Comment #6
mikeryanEverything looks OK to me. Is it possible that when you initially defined your migration, you had an integer key in the MigrateSQLMap call? Changing the key in the code will not automatically change the associated tables. What you can do is:
Comment #7
FrequenceBanane commentedIt works fine,thanks a lot !
Comment #8
mikeryanComment #10
Anonymous (not verified) commentedI just ran into this same issue. The comments above fixed it, but shouldn't this be part of the module's job? Ensuring the datatype specified in code matches the datatype in the actual db?
To be specific, for my instance, I changed the pk source mapping to a varchar map from the original integer map. This was my original migrate_map_basicpage structure (BasicPage was my particular MigrateSource implementation):
Dropping the table and allowing a rebuild (by refreshing the applicable migration admin page) gave me this instead:
Before the manual drop, I would repeatedly get the error described above.
Comment #11
peteruithoven commentedI ran into the same problem. (Migrating flickr files where I used the photo id as key, which are numbers like 5014347105).
I had to manually change the type and length of the sourceid1 fields of the following tables:
So I agree with abeal that this would be a nice improvement. Is there any way to get this into the gui?
Comment #12
mikeryanPlease don't reopen long-closed issues.
There is an existing feature request for changing map/message table schemas at #1175304: warn if map/message tables are out of sync with key schema.
Comment #13
vacilando commentedJust to note that I've also been bitten by this after migrating to 7.x-2.x-dev. Instructions in #6 did help.