From 7edfa8a290317e073089f1f70cecf9e4dd277be7 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Sat, 25 Jun 2005 19:42:40 +0000
Subject: [PATCH] New: Ajout index sur code client et code compta

---
 mysql/migration/1.1.0-2.0.0.sql  | 5 +++++
 mysql/tables/llx_societe.key.sql | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/mysql/migration/1.1.0-2.0.0.sql b/mysql/migration/1.1.0-2.0.0.sql
index a64c5d91bd4..f257c2676e7 100644
--- a/mysql/migration/1.1.0-2.0.0.sql
+++ b/mysql/migration/1.1.0-2.0.0.sql
@@ -191,6 +191,11 @@ alter table llx_societe add capital real after tva_intra;
 alter table llx_societe add rubrique varchar(255);
 alter table llx_societe add remise_client real default 0;
 
+update llx_societe set prefix_comm = null where prefix_comm = '';
+update llx_societe set code_client = null where code_client = '';
+ALTER TABLE llx_societe ADD UNIQUE uk_societe_prefix_comm(prefix_comm);
+ALTER TABLE llx_societe ADD UNIQUE uk_societe_code_client(code_client);
+
 insert into llx_const (name, value, type, note, visible) values ('ADHERENT_MAIL_REQUIRED','1','yesno','Le mail est obligatoire pour cr�er un adh�rent',0);
 
 alter table llx_societe add fk_forme_juridique integer default 0 after fk_typent;
diff --git a/mysql/tables/llx_societe.key.sql b/mysql/tables/llx_societe.key.sql
index 9ae02d5c513..c9925397c44 100644
--- a/mysql/tables/llx_societe.key.sql
+++ b/mysql/tables/llx_societe.key.sql
@@ -21,6 +21,6 @@
 -- ===================================================================
 
 
-ALTER TABLE llx_societe ADD UNIQUE uk_prefix_comm(prefix_comm);
-ALTER TABLE llx_societe ADD UNIQUE uk_code_client(code_client);
-ALTER TABLE llx_societe ADD UNIQUE uk_code_compta(code_compta);
+ALTER TABLE llx_societe ADD UNIQUE uk_societe_prefix_comm(prefix_comm);
+ALTER TABLE llx_societe ADD UNIQUE uk_societe_code_client(code_client);
+ALTER TABLE llx_societe ADD UNIQUE uk_societe_code_compta(code_compta);
-- 
GitLab