| @@ 584-600 (lines=17) @@ | ||
| 581 | /** |
|
| 582 | * @inheritdoc |
|
| 583 | */ |
|
| 584 | public function deleteColumn($name, $table) |
|
| 585 | { |
|
| 586 | $tableGateway = $this->getTableGateway($table); |
|
| 587 | $success = $tableGateway->dropColumn($name); |
|
| 588 | ||
| 589 | $response = [ |
|
| 590 | 'success' => (bool) $success |
|
| 591 | ]; |
|
| 592 | ||
| 593 | if (!$success) { |
|
| 594 | $response['error'] = [ |
|
| 595 | 'message' => sprintf('unable_to_remove_column_%s', ['column_name' => $name]) |
|
| 596 | ]; |
|
| 597 | } |
|
| 598 | ||
| 599 | return $this->createResponseFromData($response); |
|
| 600 | } |
|
| 601 | ||
| 602 | /** |
|
| 603 | * @inheritdoc |
|
| @@ 613-629 (lines=17) @@ | ||
| 610 | /** |
|
| 611 | * @inheritdoc |
|
| 612 | */ |
|
| 613 | public function deleteTable($name) |
|
| 614 | { |
|
| 615 | $tableGateway = $this->getTableGateway($name); |
|
| 616 | $success = $tableGateway->drop(); |
|
| 617 | ||
| 618 | $response = [ |
|
| 619 | 'success' => (bool) $success |
|
| 620 | ]; |
|
| 621 | ||
| 622 | if (!$success) { |
|
| 623 | $response['error'] = [ |
|
| 624 | 'message' => sprintf('unable_to_remove_table_%s', ['table_name' => $name]) |
|
| 625 | ]; |
|
| 626 | } |
|
| 627 | ||
| 628 | return $this->createResponseFromData($response); |
|
| 629 | } |
|
| 630 | ||
| 631 | /** |
|
| 632 | * Get a table gateway for the given table name |
|