From 36c8bbdf3cda22db47b9daffd220c4d01f8ec0fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 16 Nov 2011 23:38:54 +0100 Subject: [PATCH] Fix: Make a field not null as it is used with inner join. --- htdocs/install/mysql/migration/3.1.0-3.2.0.sql | 5 +++++ htdocs/install/mysql/tables/llx_societe.sql | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql index 01b895d4c3c..a4b7fe38f94 100755 --- a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql +++ b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql @@ -98,3 +98,8 @@ ALTER TABLE llx_commande MODIFY ref_client varchar(255); ALTER TABLE llx_facture MODIFY ref_int varchar(255); ALTER TABLE llx_facture MODIFY ref_ext varchar(255); ALTER TABLE llx_facture MODIFY ref_client varchar(255); + + +UPDATE llx_societe SET fk_stcomm = 0 WHERE fk_stcomm IS NULL; +ALTER TABLE llx_societe MODIFY COLUMN fk_stcomm integer NOT NULL; + diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index d78d9218323..c0dd6594457 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -34,7 +34,7 @@ create table llx_societe datec datetime, -- creation date datea datetime, -- activation date - status tinyint DEFAULT 1, -- cessation d'activité ( 1 -- en activité, 0 -- cessation d'activité) + status tinyint DEFAULT 1, -- cessation d'activité ( 1 -- en activité, 0 -- cessation d'activité) code_client varchar(24), -- code client code_fournisseur varchar(24), -- code founisseur @@ -61,7 +61,7 @@ create table llx_societe tva_intra varchar(20), -- tva capital real, -- capital de la societe description text, -- - fk_stcomm smallint DEFAULT 0, -- commercial statut + fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut note text, -- services tinyint DEFAULT 0, -- prefix_comm varchar(5), -- prefix commercial