Commit 82f0e5f9 authored by lsmith's avatar lsmith

- do not force a DEFAULT NULL on LOB fields

parent 982205b8
......@@ -731,7 +731,9 @@ class Doctrine_Export extends Doctrine_Connection_Module
*/
public function getDefaultFieldDeclaration($field)
{
$default = empty($field['notnull']) ? ' DEFAULT NULL' : '';
$default = empty($field['notnull']) && !in_array($field['type'], array('clob', 'blob'))
? ' DEFAULT NULL' : '';
if (isset($field['default'])) {
if ($field['default'] === '') {
$field['default'] = null;
......
......@@ -512,7 +512,9 @@ class Doctrine_Export_Mysql extends Doctrine_Export
*/
public function getDefaultFieldDeclaration($field)
{
$default = empty($field['notnull']) ? ' DEFAULT NULL' : '';
$default = empty($field['notnull']) && !in_array($field['type'], array('clob', 'blob'))
? ' DEFAULT NULL' : '';
if (isset($field['default']) && ( ! isset($field['length']) || $field['length'] <= 255)) {
if ($field['default'] === '') {
$field['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