varchar max length fix
This commit is contained in:
parent
81a8f3d545
commit
b4099e45aa
@ -96,7 +96,8 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
||||
'escape' => false,
|
||||
'escape_pattern' => false
|
||||
),
|
||||
'wildcards' => array('%', '_')
|
||||
'wildcards' => array('%', '_'),
|
||||
'varchar_max_length' => 255,
|
||||
);
|
||||
/**
|
||||
* @var array $serverInfo
|
||||
|
@ -152,10 +152,10 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
|
||||
}
|
||||
}
|
||||
|
||||
$length = ($field['length'] < $this->conn->varchar_max_length) ? $field['length'] : false;
|
||||
$length = ($field['length'] <= $this->conn->varchar_max_length) ? $field['length'] : false;
|
||||
$fixed = (isset($field['fixed'])) ? $field['fixed'] : false;
|
||||
|
||||
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR(255)')
|
||||
return $fixed ? ($length ? 'CHAR(' . $length . ')' : 'CHAR(255)')
|
||||
: ($length ? 'VARCHAR(' . $length . ')' : 'TEXT');
|
||||
case 'clob':
|
||||
if (!empty($field['length'])) {
|
||||
|
Loading…
Reference in New Issue
Block a user