Skip to content

The changes from #3392 break indexes with a fixed length #3409

@leofeyer

Description

@leofeyer

BC Break Report

Q A
BC Break yes
Version 2.9.1

Summary

The changes from #3392 break indexes with a fixed length.

Previous behaviour

$table = new Table('test');
$table->addColumn('path', 'text');
$table->addIndex(['path' => 'path(768)'], 'path', [], ['lengths' => [768]]);

This added the following index:

Current behavior

Doctrine\DBAL\Schema\SchemaException:
There is no column with name 'path(768)' on table 'test'.

The exception seems to occur due to the removal of the following lines in the Table::_createIndex() method:

        if (is_numeric($columnName) && is_string($indexColOptions)) {
            $columnName = $indexColOptions;
        }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions