Skip to content
Snippets Groups Projects
Commit a9ba2f31 authored by Marcos García de La Fuente's avatar Marcos García de La Fuente
Browse files

Fix: [ bug #1810 ] [pgsql] Error while upgrading from 3.6 to 3.7

parent e4c5aa30
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Yann Droneaud <yann@droneaud.fr> * Copyright (C) 2012 Yann Droneaud <yann@droneaud.fr>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -255,7 +256,7 @@ class DoliDBPgsql extends DoliDB ...@@ -255,7 +256,7 @@ class DoliDBPgsql extends DoliDB
$newreg3=preg_replace('/ NOT NULL/i','',$newreg3); $newreg3=preg_replace('/ NOT NULL/i','',$newreg3);
$newreg3=preg_replace('/ NULL/i','',$newreg3); $newreg3=preg_replace('/ NULL/i','',$newreg3);
$newreg3=preg_replace('/ DEFAULT 0/i','',$newreg3); $newreg3=preg_replace('/ DEFAULT 0/i','',$newreg3);
$newreg3=preg_replace('/ DEFAULT \'[0-9a-zA-Z_@]*\'/i','',$newreg3); $newreg3=preg_replace('/ DEFAULT \'?[0-9a-zA-Z_@]*\'?/i','',$newreg3);
$line.= "ALTER TABLE ".$reg[1]." ALTER COLUMN ".$reg[2]." TYPE ".$newreg3; $line.= "ALTER TABLE ".$reg[1]." ALTER COLUMN ".$reg[2]." TYPE ".$newreg3;
// TODO Add alter to set default value or null/not null if there is this in $reg[3] // TODO Add alter to set default value or null/not null if there is this in $reg[3]
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment