diff -u b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php --- b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php @@ -306,7 +306,7 @@ * List of shortened indexes. */ protected function getNormalizedIndexes(array $spec) { - $indexes = parent::getNormalizedIndexes($spec); + $indexes = isset($spec['indexes']) ? $spec['indexes'] : []; foreach ($indexes as $index_name => $index_fields) { foreach ($index_fields as $index_key => $index_field) { // Get the name of the field from the index specification. diff -u b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php --- b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php @@ -648,8 +648,6 @@ throw new SchemaObjectExistsException(t("Cannot add index @name to table @table: index already exists.", array('@table' => $table, '@name' => $name))); } - $spec['indexes'][$name] = $fields; - $this->connection->query($this->_createIndexSql($table, $name, $fields)); $this->resetTableInformation($table); } @@ -784,9 +782,9 @@ } if (isset($new_keys['indexes'])) { foreach ($new_keys['indexes'] as $name => $fields) { - // Even $new_keys is not a full schema it still has 'indexes' and so is - // a partial schema. Technically addIndex() doesn't do anything with it - // so passing an empty array would work as well. + // Even though $new_keys is not a full schema it still has 'indexes' and + // so is a partial schema. Technically addIndex() doesn't do anything + // with it so passing an empty array would work as well. $this->addIndex($table, $name, $fields, $new_keys); } } diff -u b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php --- b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php @@ -593,9 +593,8 @@ throw new SchemaObjectExistsException(t("Cannot add index @name to table @table: index already exists.", array('@table' => $table, '@name' => $name))); } - $spec['indexes'][$name] = $fields; - - $statements = $this->createIndexSql($table, $spec); + $schema['indexes'][$name] = $fields; + $statements = $this->createIndexSql($table, $schema); foreach ($statements as $statement) { $this->connection->query($statement); } diff -u b/core/lib/Drupal/Core/Database/Schema.php b/core/lib/Drupal/Core/Database/Schema.php --- b/core/lib/Drupal/Core/Database/Schema.php +++ b/core/lib/Drupal/Core/Database/Schema.php @@ -462,15 +462,2 @@ /** - * Gets normalized indexes from a table specification. - * - * @param array $spec - * The table specification. - * - * @return array - * List of shortened indexes. - */ - protected function getNormalizedIndexes(array $spec) { - return isset($spec['indexes']) ? $spec['indexes'] : []; - } - - /** * Drop an index.