1
0
mirror of synced 2025-01-30 12:01:44 +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

@ -441,6 +441,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
*/
public function getIntegerDeclaration($name, $field)
{
var_dump($field);
$default = $autoinc = '';
if ( ! empty($field['autoincrement'])) {
$autoinc = ' AUTO_INCREMENT';
@ -448,7 +449,11 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
if ($field['default'] === '') {
$field['default'] = empty($field['notnull']) ? null : 0;
}
$default = ' DEFAULT '.$this->conn->quote($field['default']);
if (is_null($field['default'])) {
$default = ' DEFAULT NULL';
} else {
$default = ' DEFAULT '.$this->conn->quote($field['default']);
}
}
/**
elseif (empty($field['notnull'])) {