From db43b2d3ddbedba1a9d84d5ac8487cef58185c10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2020 13:53:35 +0100 Subject: [PATCH] Fix unique key on llx_holiday_users --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_holiday_users.key.sql | 4 ++-- htdocs/install/mysql/tables/llx_holiday_users.sql | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 91b068a3fea..7c63be071c2 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -44,6 +44,10 @@ ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande -- For v12 +ALTER TABLE llx_holiday_users DROP INDEX uk_holiday_users; +ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type); + + -- Migration to the new regions (France) UPDATE llx_c_regions set nom = 'Centre-Val de Loire' WHERE fk_pays = 1 AND code_region = 24; insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (1, 27, '21231', 0, 'Bourgogne-Franche-Comté'); diff --git a/htdocs/install/mysql/tables/llx_holiday_users.key.sql b/htdocs/install/mysql/tables/llx_holiday_users.key.sql index 0a055b6006a..8ac7919e658 100644 --- a/htdocs/install/mysql/tables/llx_holiday_users.key.sql +++ b/htdocs/install/mysql/tables/llx_holiday_users.key.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2017 Laurent Destailleur +-- Copyright (C) 2017-2020 Laurent Destailleur -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -16,4 +16,4 @@ -- -- =================================================================== -ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type, nb_holiday); +ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type); diff --git a/htdocs/install/mysql/tables/llx_holiday_users.sql b/htdocs/install/mysql/tables/llx_holiday_users.sql index 1d3bcbc9361..3f9a7e61d0a 100644 --- a/htdocs/install/mysql/tables/llx_holiday_users.sql +++ b/htdocs/install/mysql/tables/llx_holiday_users.sql @@ -1,5 +1,5 @@ -- =================================================================== --- Copyright (C) 2012-2015 Laurent Destailleur +-- Copyright (C) 2012-2020 Laurent Destailleur -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -14,6 +14,7 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -- +-- Table with remain quantity of holiday for each type of leave. -- =================================================================== CREATE TABLE llx_holiday_users