git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6751 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
clench 2009-08-19 01:55:54 +00:00
parent c2b6246e83
commit dadcfc7c6a

View file

@ -378,7 +378,10 @@
**/
function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) {
$type = $this->column_type[$type];
if(strtoupper($type)=='INTEGER') $size = '';
if(strtoupper($type)=='INTEGER') $size = null;
else if(strtoupper($type)=='BIGINT') $size = null;
else if(strtoupper($type)=='BLOB SUB_TYPE TEXT SEGMENT SIZE 32') $size = null;
else if(strtoupper($type)=='VARCHAR' && !$size) $size = 256;
$query = sprintf("ALTER TABLE \"%s%s\" ADD \"%s\" ", $this->prefix, $table_name, $column_name);
if($size) $query .= sprintf(" %s(%s) ", $type, $size);