Commit 8f5691bd authored by Gareth Evans's avatar Gareth Evans

Use name rather than index object

parent 88549007
......@@ -2308,12 +2308,13 @@ abstract class AbstractPlatform
public function getUniqueConstraintDeclarationSQL($name, Index $index)
{
$columns = $index->getQuotedColumns($this);
$name = new Identifier($name);
if (count($columns) === 0) {
throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
}
return 'CONSTRAINT ' . $index->getQuotedName($this) . ' UNIQUE ('
return 'CONSTRAINT ' . $name->getQuotedName($this) . ' UNIQUE ('
. $this->getIndexFieldDeclarationListSQL($columns)
. ')' . $this->getPartialIndexSQL($index);
}
......@@ -2332,12 +2333,13 @@ abstract class AbstractPlatform
public function getIndexDeclarationSQL($name, Index $index)
{
$columns = $index->getQuotedColumns($this);
$name = new Identifier($name);
if (count($columns) === 0) {
throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
}
return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $index->getQuotedName($this) . ' ('
return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name->getQuotedName($this) . ' ('
. $this->getIndexFieldDeclarationListSQL($columns)
. ')' . $this->getPartialIndexSQL($index);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment