From 3794c9305e159fb89c1a717c9924fc1d2d3e0280 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Tue, 6 Jan 2015 00:04:23 +0100
Subject: [PATCH] Fix: [ bug #1754 ] Error while installing 3.7

---
 htdocs/install/mysql/tables/llx_c_departements.key.sql | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/htdocs/install/mysql/tables/llx_c_departements.key.sql b/htdocs/install/mysql/tables/llx_c_departements.key.sql
index 427d031a705..66194440610 100644
--- a/htdocs/install/mysql/tables/llx_c_departements.key.sql
+++ b/htdocs/install/mysql/tables/llx_c_departements.key.sql
@@ -21,5 +21,8 @@ ALTER TABLE llx_c_departements ADD UNIQUE uk_departements (code_departement,fk_r
 
 ALTER TABLE llx_c_departements ADD INDEX idx_departements_fk_region (fk_region);
 
+-- NOTE: We duplicate creation of unique keys on llx_c_regions NOW to be able to create foreign keys. 
+ALTER TABLE llx_c_regions ADD UNIQUE INDEX uk_code_region (code_region);
+
 ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region	FOREIGN KEY (fk_region) REFERENCES llx_c_regions (code_region);
 
-- 
GitLab