/** * {@inheritdoc} */ public function changeColumn($tableName, $columnName, Column $newColumn) { $this->startCommandTimer(); $this->writeCommand('changeColumn', array($tableName, $columnName, $newColumn->getType())); $after = $newColumn->getAfter() ? ' AFTER ' . $this->quoteColumnName($newColumn->getAfter()) : ''; $this->execute(sprintf('ALTER TABLE %s CHANGE %s %s %s%s', $this->quoteTableName($tableName), $this->quoteColumnName($columnName), $this->quoteColumnName($newColumn->getName()), $this->getColumnSqlDefinition($newColumn), $after)); $this->endCommandTimer(); }
/** * Returns the name of the column to add this column after. * * @return string */ public function getAfter() { return $this->column->getAfter(); }