|
@@ 158-167 (lines=10) @@
|
| 155 |
|
* |
| 156 |
|
* @return self |
| 157 |
|
*/ |
| 158 |
|
public function addIndex(array $columnNames, $indexName = null, array $flags = [], array $options = []) |
| 159 |
|
{ |
| 160 |
|
if ($indexName == null) { |
| 161 |
|
$indexName = $this->_generateIdentifierName( |
| 162 |
|
array_merge([$this->getName()], $columnNames), "idx", $this->_getMaxIdentifierLength() |
| 163 |
|
); |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
return $this->_addIndex($this->_createIndex($columnNames, $indexName, false, false, $flags, $options)); |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
/** |
| 170 |
|
* Drops the primary key from this table. |
|
@@ 205-214 (lines=10) @@
|
| 202 |
|
* |
| 203 |
|
* @return self |
| 204 |
|
*/ |
| 205 |
|
public function addUniqueIndex(array $columnNames, $indexName = null, array $options = []) |
| 206 |
|
{ |
| 207 |
|
if ($indexName === null) { |
| 208 |
|
$indexName = $this->_generateIdentifierName( |
| 209 |
|
array_merge([$this->getName()], $columnNames), "uniq", $this->_getMaxIdentifierLength() |
| 210 |
|
); |
| 211 |
|
} |
| 212 |
|
|
| 213 |
|
return $this->_addIndex($this->_createIndex($columnNames, $indexName, true, false, [], $options)); |
| 214 |
|
} |
| 215 |
|
|
| 216 |
|
/** |
| 217 |
|
* Renames an index. |