From 679e6222f0d4d7d0a47d8af923e887b0bf4e16d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Feb 2008 23:03:00 +0000 Subject: [PATCH] New: Add field to save if product or service --- mysql/migration/2.2.0-2.4.0.sql | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mysql/migration/2.2.0-2.4.0.sql b/mysql/migration/2.2.0-2.4.0.sql index 1f6690bce48..b51b4586186 100644 --- a/mysql/migration/2.2.0-2.4.0.sql +++ b/mysql/migration/2.2.0-2.4.0.sql @@ -190,5 +190,12 @@ ALTER TABLE llx_events ADD INDEX idx_events_dateevent (dateevent); ALTER TABLE llx_c_forme_juridique ADD isvatexempted tinyint DEFAULT 0 NOT NULL after libelle; -ALTER TABLE llx_facturedet ADD product_type integer DEFAULT 0 after total_ttc; -ALTER TABLE llx_facture_fourn_det ADD product_type integer DEFAULT 0 after total_ttc; +ALTER TABLE llx_facturedet ADD product_type integer DEFAULT NULL after total_ttc; +ALTER TABLE llx_facture_fourn_det ADD product_type integer DEFAULT NULL after total_ttc; + +-- V4.1 update llx_facturedet set product_type = 0 where fk_product in (select rowid from llx_product where fk_product_type = 0); +-- V4.1 update llx_facture_fourn_det set product_type = 0 where fk_product in (select rowid from llx_product where fk_product_type = 0); +-- V4.1 update llx_facturedet set product_type = 1 where fk_product in (select rowid from llx_product where fk_product_type = 1); +-- V4.1 update llx_facture_fourn_det set product_type = 1 where fk_product in (select rowid from llx_product where fk_product_type = 1); +-- V4.1 update llx_facturedet set product_type = 1 where product_type is null; +-- V4.1 update llx_facture_fourn_det set product_type = 1 where product_type is null;