1
0
mirror of synced 2025-01-29 19:41:45 +03:00

changed getIntegerDeclaration() to handle $field['default']==NULL condition

This commit is contained in:
samw3 2007-11-08 13:58:56 +00:00
parent 93e1945144
commit 85299543a3

View File

@ -440,15 +440,20 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
* declare the specified field.
*/
public function getIntegerDeclaration($name, $field)
{
{
var_dump($field);
$default = $autoinc = '';
if ( ! empty($field['autoincrement'])) {
$autoinc = ' AUTO_INCREMENT';
} elseif (array_key_exists('default', $field)) {
if ($field['default'] === '') {
$field['default'] = empty($field['notnull']) ? null : 0;
}
if (is_null($field['default'])) {
$default = ' DEFAULT NULL';
} else {
$default = ' DEFAULT '.$this->conn->quote($field['default']);
}
$default = ' DEFAULT '.$this->conn->quote($field['default']);
}
/**
elseif (empty($field['notnull'])) {