Commit 85299543 authored by samw3's avatar samw3

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

parent 93e19451
...@@ -441,6 +441,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict ...@@ -441,6 +441,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
*/ */
public function getIntegerDeclaration($name, $field) public function getIntegerDeclaration($name, $field)
{ {
var_dump($field);
$default = $autoinc = ''; $default = $autoinc = '';
if ( ! empty($field['autoincrement'])) { if ( ! empty($field['autoincrement'])) {
$autoinc = ' AUTO_INCREMENT'; $autoinc = ' AUTO_INCREMENT';
...@@ -448,8 +449,12 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict ...@@ -448,8 +449,12 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
if ($field['default'] === '') { if ($field['default'] === '') {
$field['default'] = empty($field['notnull']) ? null : 0; $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'])) { elseif (empty($field['notnull'])) {
$default = ' DEFAULT NULL'; $default = ' DEFAULT NULL';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment