return $this->_adapter->quoteString($type == 'integer'
? $value->format('U')
: $value->format('Y-m-d H:i:s'));
+ } elseif ($type == 'integer') {
+ return (int)$value;
+ } elseif ($type == 'float') {
+ return (float)$value;
} else {
/*@TODO
when String, ActiveSupport::Multibyte::Chars
$quotedTableName,
$this->quoteString($columnName));
$res = $this->selectOne($sql);
- $currentType = $res['Type'];
+ $column = $this->makeColumn($columnName, $res['Default'], $res['Type'], $res['Null'] == 'YES');
- $default = $this->quote($default);
+ $default = $this->quote($default, $column);
$sql = sprintf('ALTER TABLE %s CHANGE %s %s %s DEFAULT %s',
$quotedTableName,
$quotedColumnName,
$quotedColumnName,
- $currentType,
+ $res['Type'],
$default);
return $this->execute($sql);
}
$this->quoteString($columnName));
$row = $this->selectOne($sql);
$options['default'] = $row['Default'];
+ $options['column'] = $this->makeColumn($columnName, $row['Default'], $row['Type'], $row['Null'] == 'YES');
}
$limit = !empty($options['limit']) ? $options['limit'] : null;