diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php index 3c65894..30435f3 100644 --- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php +++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php @@ -335,7 +335,6 @@ protected function ensureTables() { foreach ($this->migration->getDestinationPlugin()->getIds() as $id_definition) { // Allow dest identifier fields to be NULL (for IGNORED/FAILED cases). $mapkey = 'destid' . $count++; - $indexes['destination'][] = $mapkey; $fields[$mapkey] = $this->getFieldSchema($id_definition); $fields[$mapkey]['not null'] = FALSE; } diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php index 46421a1..3c9aa42 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapEnsureTablesTest.php @@ -34,6 +34,10 @@ public function testEnsureTablesNotExist() { 'type' => 'int', 'not null' => TRUE, ); + $fields['sourceid2'] = array( + 'type' => 'int', + 'not null' => TRUE, + ); $fields['destid1'] = array( 'type' => 'varchar', 'length' => 255, @@ -73,8 +77,7 @@ public function testEnsureTablesNotExist() { 'fields' => $fields, 'primary key' => array('source_ids_hash'), 'indexes' => [ - 'source' => ['sourceid1'], - 'destination' => ['destid1'], + 'source' => ['sourceid1', 'sourceid2'], ], ); $schema = $this->getMockBuilder('Drupal\Core\Database\Schema') @@ -209,6 +212,9 @@ protected function runEnsureTablesTest($schema) { 'source_id_property' => array( 'type' => 'integer', ), + 'source_id_property_2' => array( + 'type' => 'integer', + ), )); $migration->expects($this->any()) ->method('getSourcePlugin')