protected function _deleteNoLongerConfiguredColumn(Garp_Spawn_MySql_Column $targetColumn) { $source = $this->getSource(); $target = $this->getTarget(); $progress = Garp_Cli_Ui_ProgressBar::getInstance(); if ($source->columnExists($targetColumn->name)) { return; } if ($this->getFeedback()->isInteractive()) { $progress->display("Delete column {$target->name}.{$targetColumn->name}? "); if (!Garp_Spawn_Util::confirm()) { return; } } $target->deleteColumn($targetColumn); }
protected function _removeUniqueKeys(array $keysToRemove) { $progress = $this->getFeedback(); $tableName = $this->getSource()->getTableName(); foreach ($keysToRemove as $key) { $fields = $this->_model->fields->getFields('name', $key->column); $field = current($fields); $columnsOutput = implode(', ', (array) $key->column); if ($progress->isInteractive()) { $progress->display("Make {$this->_model->id}.{$columnsOutput} no longer unique? "); if (!Garp_Spawn_Util::confirm()) { continue; } } if (!Garp_Spawn_MySql_UniqueKey::delete($tableName, $key)) { throw new Exception("Could not set column '{$columnsOutput}' to non-unique."); } } }