The uc_payment_paypal_ipn table does not have a primary key. This is generating the following messages:
Notice: Undefined index: primary key in MigrateDestinationTable::getKeySchema() (line 38 of /home/spe2sp/public_html/sites/all/modules/Development/migrate/plugins/destinations/table.inc).
Warning: Invalid argument supplied for foreach() in MigrateDestinationTable::getKeySchema() (line 38 of /home/spe2sp/public_html/sites/all/modules/Development/migrate/plugins/destinations/table.inc).
I worked around the problem on the source table by making order_id the primary key.
What do I need to do to eliminate the notice and warning and ensure the migration works properly?
The end of the schema in ubercart/uc_paypal.install uc_paypal_schema() is
'indexes' => array(
'order_id' => array('order_id'),
),
'foreign keys' => array(
'uc_orders' => array(
'table' => 'uc_orders',
'columns' => array('order_id' => 'order_id'),
),
),
uc_product_adjustments has the same problem.
'indexes' => array(
'nid' => array('nid'),
),
'foreign keys' => array(
'uc_products' => array(
'table' => 'uc_products',
'columns' => array('nid' => 'nid'),
),
Comments
Comment #1
pcher1bw commentedComment #2
mikeryanMigrateDestinationTable::getKeySchema() is being helpful by automatically figuring out an appropriate key from the configured primary key of the destination table. I.e., it's assuming good SQL practice. Other than the primary key, there really isn't a good way for it to guess what an appropriate key would be to uniquely identify a table row on your destination. So, what I would do is where you're calling MigrateDestinationTable::getKeySchema() in your MigrateSQLMap construction, pass an explicit schema array like you're doing for the source table.
Comment #3
mikeryan