@@ 436-440 (lines=5) @@ | ||
433 | */ |
|
434 | public function renameIndex(array $columns, string $name): AbstractTable |
|
435 | { |
|
436 | if (!$this->hasIndex($columns)) { |
|
437 | throw new SchemaException( |
|
438 | "Undefined index ['" . join("', '", $columns) . "'] in '{$this->getName()}'" |
|
439 | ); |
|
440 | } |
|
441 | ||
442 | //Declaring new index name |
|
443 | $this->index($columns)->setName($name); |
|
@@ 495-499 (lines=5) @@ | ||
492 | */ |
|
493 | public function dropIndex(array $columns): AbstractTable |
|
494 | { |
|
495 | if (!$this->hasIndex($columns)) { |
|
496 | throw new SchemaException( |
|
497 | "Undefined index ['" . join("', '", $columns) . "'] in '{$this->getName()}'" |
|
498 | ); |
|
499 | } |
|
500 | ||
501 | //Dropping index from current schema |
|
502 | $this->currentState->forgetIndex($this->currentState->findIndex($columns)); |