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 962e05b..3c65894 100644 --- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php +++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php @@ -313,8 +313,10 @@ protected function ensureTables() { // and map from the source field names to the map/msg field names. $count = 1; $source_id_schema = array(); + $indexes = []; foreach ($this->migration->getSourcePlugin()->getIds() as $id_definition) { $mapkey = 'sourceid' . $count++; + $indexes['source'][] = $mapkey; $source_id_schema[$mapkey] = $this->getFieldSchema($id_definition); $source_id_schema[$mapkey]['not null'] = TRUE; } @@ -333,6 +335,7 @@ 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; } @@ -369,6 +372,7 @@ protected function ensureTables() { 'description' => 'Mappings from source identifier value(s) to destination identifier value(s).', 'fields' => $fields, 'primary key' => array(static::SOURCE_IDS_HASH), + 'indexes' => $indexes, ); $this->getDatabase()->schema()->createTable($this->mapTableName, $schema);