| @@ 507-517 (lines=11) @@ | ||
| 504 | * |
|
| 505 | * @throws SchemaException |
|
| 506 | */ |
|
| 507 | public function dropColumn(string $column): AbstractTable |
|
| 508 | { |
|
| 509 | if (empty($schema = $this->current->findColumn($column))) { |
|
| 510 | throw new SchemaException("Undefined column '{$column}' in '{$this->getName()}'"); |
|
| 511 | } |
|
| 512 | ||
| 513 | //Dropping column from current schema |
|
| 514 | $this->current->forgetColumn($schema); |
|
| 515 | ||
| 516 | return $this; |
|
| 517 | } |
|
| 518 | ||
| 519 | /** |
|
| 520 | * Drop index by it's forming columns. |
|
| @@ 551-563 (lines=13) @@ | ||
| 548 | * |
|
| 549 | * @throws SchemaException |
|
| 550 | */ |
|
| 551 | public function dropForeign($column): AbstractTable |
|
| 552 | { |
|
| 553 | if (!empty($schema = $this->current->findForeign($column))) { |
|
| 554 | throw new SchemaException( |
|
| 555 | "Undefined FK on '{$column}' in '{$this->getName()}'" |
|
| 556 | ); |
|
| 557 | } |
|
| 558 | ||
| 559 | //Dropping foreign from current schema |
|
| 560 | $this->current->forgetForeign($schema); |
|
| 561 | ||
| 562 | return $this; |
|
| 563 | } |
|
| 564 | ||
| 565 | /** |
|
| 566 | * Reset table state to new form. |
|