@@ 2338-2350 (lines=13) @@ | ||
2335 | * |
|
2336 | * @throws \InvalidArgumentException |
|
2337 | */ |
|
2338 | public function getUniqueConstraintDeclarationSQL($name, Index $index) |
|
2339 | { |
|
2340 | $columns = $index->getQuotedColumns($this); |
|
2341 | $name = new Identifier($name); |
|
2342 | ||
2343 | if (count($columns) === 0) { |
|
2344 | throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); |
|
2345 | } |
|
2346 | ||
2347 | return 'CONSTRAINT ' . $name->getQuotedName($this) . ' UNIQUE (' |
|
2348 | . $this->getIndexFieldDeclarationListSQL($columns) |
|
2349 | . ')' . $this->getPartialIndexSQL($index); |
|
2350 | } |
|
2351 | ||
2352 | /** |
|
2353 | * Obtains DBMS specific SQL code portion needed to set an index |
|
@@ 2363-2375 (lines=13) @@ | ||
2360 | * |
|
2361 | * @throws \InvalidArgumentException |
|
2362 | */ |
|
2363 | public function getIndexDeclarationSQL($name, Index $index) |
|
2364 | { |
|
2365 | $columns = $index->getQuotedColumns($this); |
|
2366 | $name = new Identifier($name); |
|
2367 | ||
2368 | if (count($columns) === 0) { |
|
2369 | throw new \InvalidArgumentException("Incomplete definition. 'columns' required."); |
|
2370 | } |
|
2371 | ||
2372 | return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name->getQuotedName($this) . ' (' |
|
2373 | . $this->getIndexFieldDeclarationListSQL($columns) |
|
2374 | . ')' . $this->getPartialIndexSQL($index); |
|
2375 | } |
|
2376 | ||
2377 | /** |
|
2378 | * Obtains SQL code portion needed to create a custom column, |