From c6a796d270efaaca1914e41540f13863b579a1ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Oct 2019 15:45:32 +0200 Subject: [PATCH] Try to fix #12097 --- htdocs/core/db/pgsql.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 637aac02545..2347d3d77e5 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -199,6 +199,12 @@ class DoliDBPgsql extends DoliDB $line=$newline; } + if (preg_match('/[\s\t\(]*(\w*)[\s\t]+bigint.*auto_increment/i', $line, $reg)) { + $newline=preg_replace('/([\s\t\(]*)([a-zA-Z_0-9]*)[\s\t]+int.*auto_increment[^,]*/i', '\\1 \\2 BIGSERIAL PRIMARY KEY', $line); + //$line = "-- ".$line." replaced by --\n".$newline; + $line=$newline; + } + // tinyint type conversion $line=preg_replace('/tinyint\(?[0-9]*\)?/', 'smallint', $line); $line=preg_replace('/tinyint/i', 'smallint', $line);