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