|
@@ 2376-2388 (lines=13) @@
|
| 2373 |
|
* |
| 2374 |
|
* @throws \InvalidArgumentException |
| 2375 |
|
*/ |
| 2376 |
|
public function getUniqueConstraintDeclarationSQL($name, Index $index) |
| 2377 |
|
{ |
| 2378 |
|
$columns = $index->getQuotedColumns($this); |
| 2379 |
|
$name = new Identifier($name); |
| 2380 |
|
|
| 2381 |
|
if (count($columns) === 0) { |
| 2382 |
|
throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); |
| 2383 |
|
} |
| 2384 |
|
|
| 2385 |
|
return 'CONSTRAINT ' . $name->getQuotedName($this) . ' UNIQUE (' |
| 2386 |
|
. $this->getIndexFieldDeclarationListSQL($columns) |
| 2387 |
|
. ')' . $this->getPartialIndexSQL($index); |
| 2388 |
|
} |
| 2389 |
|
|
| 2390 |
|
/** |
| 2391 |
|
* Obtains DBMS specific SQL code portion needed to set an index |
|
@@ 2401-2413 (lines=13) @@
|
| 2398 |
|
* |
| 2399 |
|
* @throws \InvalidArgumentException |
| 2400 |
|
*/ |
| 2401 |
|
public function getIndexDeclarationSQL($name, Index $index) |
| 2402 |
|
{ |
| 2403 |
|
$columns = $index->getQuotedColumns($this); |
| 2404 |
|
$name = new Identifier($name); |
| 2405 |
|
|
| 2406 |
|
if (count($columns) === 0) { |
| 2407 |
|
throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); |
| 2408 |
|
} |
| 2409 |
|
|
| 2410 |
|
return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name->getQuotedName($this) . ' (' |
| 2411 |
|
. $this->getIndexFieldDeclarationListSQL($columns) |
| 2412 |
|
. ')' . $this->getPartialIndexSQL($index); |
| 2413 |
|
} |
| 2414 |
|
|
| 2415 |
|
/** |
| 2416 |
|
* Obtains SQL code portion needed to create a custom column, |