mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-18 04:20:05 +02:00
updates to work around postgres error while upgrading a phpGW 0.9.14 install
This commit is contained in:
@@ -134,10 +134,11 @@ class ADODB2_postgres extends ADODB_DataDict {
|
||||
if (($not_null = preg_match('/NOT NULL/i',$v))) {
|
||||
$v = preg_replace('/NOT NULL/i','',$v);
|
||||
}
|
||||
if (preg_match('/^([^ ]+) .*(DEFAULT [^ ]+)/',$v,$matches)) {
|
||||
if (preg_match('/^([^ ]+) .*DEFAULT ([^ ]+)/',$v,$matches)) {
|
||||
list(,$colname,$default) = $matches;
|
||||
$sql[] = $alter . str_replace($default,'',$v);
|
||||
$sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET ' . $default;
|
||||
$sql[] = $alter . str_replace('DEFAULT '.$default,'',$v);
|
||||
$sql[] = 'UPDATE '.$tabname.' SET '.$colname.'='.$default;
|
||||
$sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET DEFAULT ' . $default;
|
||||
} else {
|
||||
$sql[] = $alter . $v;
|
||||
}
|
||||
|
Reference in New Issue
Block a user