Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Schema.php

function Schema::shortenIndex

Helper function for normalizeIndexes().

Shortens an index to 191 characters.

Parameters

array $index: The index array to be used in createKeySql.

See also

Drupal\mysql\Driver\Database\mysql\Schema::createKeySql()

Drupal\mysql\Driver\Database\mysql\Schema::normalizeIndexes()

1 call to Schema::shortenIndex()
Schema::getNormalizedIndexes in core/modules/mysql/src/Driver/Database/mysql/Schema.php
Gets normalized indexes from a table specification.

File

core/modules/mysql/src/Driver/Database/mysql/Schema.php, line 347

Class

Schema
MySQL implementation of \Drupal\Core\Database\Schema.

Namespace

Drupal\mysql\Driver\Database\mysql

Code

protected function shortenIndex(&$index) {
    if (is_array($index)) {
        if ($index[1] > 191) {
            $index[1] = 191;
        }
    }
    else {
        $index = [
            $index,
            191,
        ];
    }
}
RSS feed
Powered by Drupal