From 85299543a379261fb0f71a5d25c3eb1dcef669d7 Mon Sep 17 00:00:00 2001
From: samw3 <samw3@625475ce-881a-0410-a577-b389adb331d8>
Date: Thu, 8 Nov 2007 13:58:56 +0000
Subject: [PATCH] changed getIntegerDeclaration() to handle
 $field['default']==NULL condition

---
 lib/Doctrine/DataDict/Mysql.php | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/Doctrine/DataDict/Mysql.php b/lib/Doctrine/DataDict/Mysql.php
index 830ec2e2a..a35c253d9 100644
--- a/lib/Doctrine/DataDict/Mysql.php
+++ b/lib/Doctrine/DataDict/Mysql.php
@@ -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'])) {