public function changeColumn($table,
$originalName,
$newName,
$type,
$defaultValue = null
) { $this->
validate($table,
$originalName);
if (!
$newName) { throw new Exception('No column name provided'
);
} if (!
$type) { throw new Exception('No column type provided'
);
} $this->
validateField($newName);
$defaultValue =
$this->
filterDefaultValue($defaultValue);
$sql =
sprintf( 'ALTER TABLE `%s` CHANGE `%s` `%s` %s NULL DEFAULT %s;',
$table,
$originalName,
$newName,
$type,
$defaultValue );