Fix: Enhance pgsql driver

This commit is contained in:
eldy 2013-02-21 21:04:20 +01:00
parent bfc4df5169
commit 3d80a6ebfc
3 changed files with 6 additions and 10 deletions

View File

@ -25,9 +25,7 @@
/**
* \class DoliDBMssql
* \brief Classe de gestion de la database de dolibarr
* \remarks Works with PHP5 Only
* Classe de gestion de la database de dolibarr
*/
class DoliDBMssql
{

View File

@ -29,8 +29,7 @@
/**
* \class DoliDBPgsql
* \brief Class to drive a Postgresql database for Dolibarr
* Class to drive a Postgresql database for Dolibarr
*/
class DoliDBPgsql
{
@ -245,17 +244,17 @@ class DoliDBPgsql
$line=preg_replace('/\sAFTER [a-z0-9_]+/i','',$line);
// We remove start of requests "ALTER TABLE tablexxx" if this is a DROP INDEX
$line=preg_replace('/ALTER TABLE [a-z0-9_]+ DROP INDEX/i','DROP INDEX',$line);
$line=preg_replace('/ALTER TABLE [a-z0-9_]+\s+DROP INDEX/i','DROP INDEX',$line);
// Translate order to rename fields
if (preg_match('/ALTER TABLE ([a-z0-9_]+) CHANGE(?: COLUMN)? ([a-z0-9_]+) ([a-z0-9_]+)(.*)$/i',$line,$reg))
if (preg_match('/ALTER TABLE ([a-z0-9_]+)\s+CHANGE(?: COLUMN)? ([a-z0-9_]+) ([a-z0-9_]+)(.*)$/i',$line,$reg))
{
$line = "-- ".$line." replaced by --\n";
$line.= "ALTER TABLE ".$reg[1]." RENAME COLUMN ".$reg[2]." TO ".$reg[3];
}
// Translate order to modify field format
if (preg_match('/ALTER TABLE ([a-z0-9_]+) MODIFY(?: COLUMN)? ([a-z0-9_]+) (.*)$/i',$line,$reg))
if (preg_match('/ALTER TABLE ([a-z0-9_]+)\s+MODIFY(?: COLUMN)? ([a-z0-9_]+) (.*)$/i',$line,$reg))
{
$line = "-- ".$line." replaced by --\n";
$newreg3=$reg[3];

View File

@ -26,8 +26,7 @@
/**
* \class DoliDBSqlite
* \brief Class to manage Dolibarr database access for a Sqlite database
* Class to manage Dolibarr database access for a Sqlite database
*/
class DoliDBSqlite
{