public function add_column($table_name, $column_name, $type, $options = array())
{
if (empty($table_name)) {
throw new Ruckusing_Exception("Missing table name parameter", Ruckusing_Exception::INVALID_ARGUMENT);
}
if (empty($column_name)) {
throw new Ruckusing_Exception("Missing column name parameter", Ruckusing_Exception::INVALID_ARGUMENT);
}
if (empty($type)) {
throw new Ruckusing_Exception("Missing type parameter", Ruckusing_Exception::INVALID_ARGUMENT);
}
$defaultOptions = array('limit' => null, 'precision' => null, 'scale' => null);
$options = array_merge($defaultOptions, $options);
$sql = sprintf("ALTER TABLE %s ADD COLUMN %s %s", $this->quote_table_name($table_name), $this->quote_column_name($column_name), $this->type_to_sql($type, $options));
$sql .= $this->add_column_options($type, $options);
return $this->execute_ddl($sql);
}