Skip to content

Commit

Permalink
Get uniques using getTableIndexes() and getTableUniques()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Aug 19, 2023
1 parent 7145e81 commit dbe3957
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/QueryBuilder/AbstractDMLQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Yiisoft\Db\QueryBuilder;

use Generator;
use JsonException;
use Yiisoft\Db\Constraint\Constraint;
use Yiisoft\Db\Constraint\IndexConstraint;
Expand Down Expand Up @@ -335,17 +334,15 @@ private function getTableUniqueColumnNames(string $name, array $columns, array &
$constraints[] = $primaryKey;
}

// TODO remove getTableIndexes(), getTableUniques() should be enough
/** @psalm-var IndexConstraint[] $tableIndexes */
/*
$tableIndexes = $this->schema->getTableIndexes($name);

foreach ($tableIndexes as $constraint) {
if ($constraint->isUnique()) {
$constraints[] = $constraint;
}
}
*/

$constraints = array_merge($constraints, $this->schema->getTableUniques($name));

/**
Expand Down

0 comments on commit dbe3957

Please sign in to comment.