mirror of
https://github.com/nextcloud/server.git
synced 2024-07-24 21:34:53 +02:00
fix for pgsql database migration
This commit is contained in:
parent
8b4e16ec77
commit
d98a0a1bb9
3
3rdparty/MDB2/Driver/Manager/pgsql.php
vendored
3
3rdparty/MDB2/Driver/Manager/pgsql.php
vendored
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user