Found a bug in
MigrateDestinationTable::import()

The variable $primary_key is only filled in case of regular update, but not in case of Migration::DESTINATION.
Result: An integrity constraint violation.

Solution: One line to add.

<?php
    if ($migration->getSystemOfRecord() == Migration::DESTINATION) {
      foreach ($this->schema['primary key'] as $key) {
        $primary_key[] = $key;
        if (!isset($entity->{$key})) {
          throw new MigrateException(t('System-of-record is DESTINATION, but no destination id provided'));
        }
      }
?>

Comments

mikeryan’s picture

Status: Active » Fixed

Committed to D6 and D7, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.