]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix for pgsql database migration
authorRobin Appelman <icewind@owncloud.com>
Wed, 30 May 2012 21:55:27 +0000 (23:55 +0200)
committerRobin Appelman <icewind@owncloud.com>
Wed, 30 May 2012 22:01:49 +0000 (00:01 +0200)
3rdparty/MDB2/Driver/Manager/pgsql.php

index a7b776cc1b70c755300fad2b7c802d0eb4d04677..f2c2137dc8b3b1c6c536392b5dd26eb229a55060 100644 (file)
@@ -410,6 +410,9 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
                     }
                     $db->loadModule('Datatype', null, true);
                     $type = $db->datatype->getTypeDeclaration($field['definition']);
+                    if($type=='SERIAL PRIMARY KEY'){//not correct when altering a table, since serials arent a real type
+                                               $type='INTEGER';//use integer instead
+                    }
                     $query = "ALTER $field_name TYPE $type USING CAST($field_name AS $type)";
                     $result = $db->exec("ALTER TABLE $name $query");
                     if (PEAR::isError($result)) {