1
0
mirror of synced 2025-01-17 22:11:41 +03:00
This commit is contained in:
zYne 2007-09-17 20:41:24 +00:00
parent 670b4831a7
commit d6fd3e16e0

View File

@ -368,15 +368,15 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
case 'string':
case 'array':
case 'object':
case 'varchar':
case 'varchar':
case 'gzip':
$length = (isset($field['length']) && $field['length']) ? $field['length'] : null;
// TODO: $this->conn->options['default_text_field_length'];
// TODO: what is the maximum VARCHAR length in pgsql ?
$length = (isset($field['length']) && $field['length'] && ! ($field['length'] > 1000000)) ? $field['length'] : null;
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->options['default_text_field_length'].')')
: ($length ? 'VARCHAR('.$length.')' : 'TEXT');
return $fixed ? ($length ? 'CHAR(' . $length . ')' : 'CHAR('.$this->conn->options['default_text_field_length'].')')
: ($length ? 'VARCHAR(' .$length . ')' : 'TEXT');
case 'clob':
return 'TEXT';