1
0
mirror of synced 2025-01-18 06:21:40 +03:00

- do not force a DEFAULT NULL on LOB fields

This commit is contained in:
lsmith 2008-01-10 13:19:17 +00:00
parent 982205b8fa
commit 82f0e5f92c
2 changed files with 6 additions and 2 deletions

View File

@ -731,7 +731,9 @@ class Doctrine_Export extends Doctrine_Connection_Module
*/ */
public function getDefaultFieldDeclaration($field) 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 (isset($field['default'])) {
if ($field['default'] === '') { if ($field['default'] === '') {
$field['default'] = null; $field['default'] = null;

View File

@ -512,7 +512,9 @@ class Doctrine_Export_Mysql extends Doctrine_Export
*/ */
public function getDefaultFieldDeclaration($field) 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 (isset($field['default']) && ( ! isset($field['length']) || $field['length'] <= 255)) {
if ($field['default'] === '') { if ($field['default'] === '') {
$field['default'] = null; $field['default'] = null;