@@ 561-577 (lines=17) @@ | ||
558 | /** |
|
559 | * @inheritdoc |
|
560 | */ |
|
561 | public function deleteColumn($name, $table) |
|
562 | { |
|
563 | $tableGateway = $this->getTableGateway($table); |
|
564 | $success = $tableGateway->dropColumn($name); |
|
565 | ||
566 | $response = [ |
|
567 | 'success' => (bool) $success |
|
568 | ]; |
|
569 | ||
570 | if (!$success) { |
|
571 | $response['error'] = [ |
|
572 | 'message' => sprintf('unable_to_remove_column_%s', ['column_name' => $name]) |
|
573 | ]; |
|
574 | } |
|
575 | ||
576 | return $this->createResponseFromData($response); |
|
577 | } |
|
578 | ||
579 | /** |
|
580 | * @inheritdoc |
|
@@ 590-606 (lines=17) @@ | ||
587 | /** |
|
588 | * @inheritdoc |
|
589 | */ |
|
590 | public function deleteTable($name) |
|
591 | { |
|
592 | $tableGateway = $this->getTableGateway($name); |
|
593 | $success = $tableGateway->drop(); |
|
594 | ||
595 | $response = [ |
|
596 | 'success' => (bool) $success |
|
597 | ]; |
|
598 | ||
599 | if (!$success) { |
|
600 | $response['error'] = [ |
|
601 | 'message' => sprintf('unable_to_remove_table_%s', ['table_name' => $name]) |
|
602 | ]; |
|
603 | } |
|
604 | ||
605 | return $this->createResponseFromData($response); |
|
606 | } |
|
607 | ||
608 | /** |
|
609 | * Get a table gateway for the given table name |