From ee15efdd7ef4925ba0ad1a0bcabf840732ba1079 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Mar 2011 23:37:28 +0000 Subject: [PATCH] Fix: Uniformize field type. This also fix postgreql compatibility. --- htdocs/install/mysql/migration/2.9.0-3.0.0.sql | 3 +++ htdocs/install/mysql/tables/llx_paiement.sql | 2 +- htdocs/install/mysql/tables/llx_paiementfourn.sql | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql index 12565d78152..de6f0f96f1d 100644 --- a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql +++ b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql @@ -11,6 +11,9 @@ -- To remove a column: ALTER TABLE llx_table DROP COLUMN colname; -- +ALTER TABLE llx_paiement MODIFY amount double(24,8); +ALTER TABLE llx_paiement_facture MODIFY amount double(24,8); + -- Fix bad old data UPDATE llx_bank_url SET type='payment' WHERE type='?' AND label='(payment)' AND url LIKE '%compta/paiement/fiche.php%'; diff --git a/htdocs/install/mysql/tables/llx_paiement.sql b/htdocs/install/mysql/tables/llx_paiement.sql index ce7e2e6ff67..c3b4ca0da9a 100644 --- a/htdocs/install/mysql/tables/llx_paiement.sql +++ b/htdocs/install/mysql/tables/llx_paiement.sql @@ -29,7 +29,7 @@ create table llx_paiement datec datetime, -- date de creation tms timestamp, datep datetime, -- payment date - amount real DEFAULT 0, + amount double(24,8) DEFAULT 0, fk_paiement integer NOT NULL, num_paiement varchar(50), note text, diff --git a/htdocs/install/mysql/tables/llx_paiementfourn.sql b/htdocs/install/mysql/tables/llx_paiementfourn.sql index a3c542ea7e2..b2848821db0 100644 --- a/htdocs/install/mysql/tables/llx_paiementfourn.sql +++ b/htdocs/install/mysql/tables/llx_paiementfourn.sql @@ -25,7 +25,7 @@ create table llx_paiementfourn tms timestamp, datec datetime, -- date de creation de l'enregistrement datep datetime, -- date de paiement - amount real DEFAULT 0, -- montant + amount double(24,8) DEFAULT 0, -- montant fk_user_author integer, -- auteur fk_paiement integer NOT NULL, -- moyen de paiement num_paiement varchar(50), -- numero de paiement (cheque)