mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
fix for pgsql database migration
This commit is contained in:
parent
449b9b92f0
commit
f4577bf00c
1 changed files with 3 additions and 0 deletions
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 a new issue