Skip to content

Commit

Permalink
fixup! fix(Table): support for index declared with single field as st…
Browse files Browse the repository at this point in the history
…ring
  • Loading branch information
alquerci committed Apr 12, 2024
1 parent df3108e commit a7cfab2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lib/Doctrine/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,9 @@ public function addCheckConstraint($definition, $name)
public function addIndex($index, array $definition)
{
if (isset($definition['fields'])) {
foreach ((array) $definition['fields'] as $key => $field) {
$definition['fields'] = (array) $definition['fields'];

foreach ($definition['fields'] as $key => $field) {
if (is_numeric($key)) {
$definition['fields'][$key] = $this->getColumnName($field);
} else {
Expand Down
7 changes: 1 addition & 6 deletions tests/Table/IndexesUsingSingleFieldStringTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

class Doctrine_Table_IndexesUsingSingleFieldString_TestCase extends Doctrine_UnitTestCase
{
public function prepareTables()
{
$this->tables = array('IndexDeclaredWithSingleFieldStringRecord');

parent::prepareTables();
}
protected $tables = array('IndexDeclaredWithSingleFieldStringRecord');

public function testSupportIndexesUsingSingleFieldString()
{
Expand Down

0 comments on commit a7cfab2

Please sign in to comment.