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