From 7a670c5bc7174f0707e24a5dbb5209155369ce49 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 May 2014 19:39:34 +0200 Subject: [PATCH 1/3] Fix: pgsql driver not complete Conflicts: htdocs/core/db/pgsql.class.php --- htdocs/core/db/pgsql.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 010fcf191cc..a46141dc2fd 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -190,6 +190,8 @@ class DoliDBPgsql extends DoliDB else if (preg_match('/DROP TABLE/i',$line)) $type='dml'; } + $line=preg_replace('/ as signed\)/i',' as integer\)',$line); + if ($type == 'dml') { $line=preg_replace('/\s/',' ',$line); // Replace tabulation with space @@ -214,8 +216,7 @@ class DoliDBPgsql extends DoliDB // nuke unsigned $line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line); - $line=preg_replace('/as signed/i','as integer',$line); - + // blob -> text $line=preg_replace('/\w*blob/i','text',$line); From b75dea98ee6cc0718ed4e0ad061297a5c6210016 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 May 2014 19:46:32 +0200 Subject: [PATCH 2/3] Fix: sql syntax --- htdocs/core/db/pgsql.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index a46141dc2fd..efb9888f8b3 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -190,7 +190,7 @@ class DoliDBPgsql extends DoliDB else if (preg_match('/DROP TABLE/i',$line)) $type='dml'; } - $line=preg_replace('/ as signed\)/i',' as integer\)',$line); + $line=preg_replace('/ as signed\)/i',' as integer)',$line); if ($type == 'dml') { From 67bd18f5cca2716f758d1b2dadc5885c91abee85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 May 2014 20:25:41 +0200 Subject: [PATCH 3/3] Fix: [ bug #1406 ] Impossible de modifier une facture fournisseur --- htdocs/install/mysql/migration/3.4.0-3.5.0.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index bf48ab3207f..87579367a8a 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -11,8 +11,10 @@ -- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; -- To restrict request to Mysql version x.y use -- VMYSQLx.y -- To restrict request to Pgsql version x.y use -- VPGSQLx.y --- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; --- To make pk to be auto increment (postgres) VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE +-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE +-- To remove a not null status (mysql): VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN colname integer NULL; +-- To remove a not null status (postgres): VPGSQL8.2 ALTER TABLE llx_table ALTER colname DROP NOT NULL; -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); @@ -323,6 +325,8 @@ ALTER TABLE llx_facture_fourn ADD fk_mode_reglement integer NULL AFTER fk_cond_r ALTER TABLE llx_facture_fourn MODIFY COLUMN fk_mode_reglement integer NULL; ALTER TABLE llx_facture_fourn MODIFY COLUMN fk_cond_reglement integer NULL; +-- VPGSQL8.2 ALTER TABLE llx_facture_fourn ALTER fk_mode_reglement DROP NOT NULL; +-- VPGSQL8.2 ALTER TABLE llx_facture_fourn ALTER fk_cond_reglement DROP NOT NULL; INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (9,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1);