From a9ba2f317986ca4542dbdcdda07504ad0691d98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 2 Feb 2015 11:48:57 +0100 Subject: [PATCH] Fix: [ bug #1810 ] [pgsql] Error while upgrading from 3.6 to 3.7 --- htdocs/core/db/pgsql.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 7381fd77b93..58e79da87b9 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Yann Droneaud * Copyright (C) 2012 Florian Henry + * Copyright (C) 2015 Marcos GarcĂ­a * * 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 @@ -255,7 +256,7 @@ class DoliDBPgsql extends DoliDB $newreg3=preg_replace('/ NOT NULL/i','',$newreg3); $newreg3=preg_replace('/ NULL/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; // TODO Add alter to set default value or null/not null if there is this in $reg[3] }