diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index 5c1f5f748d9..8962413f000 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -88,7 +88,7 @@ create table llx_comfourn_facfourn alter table llx_categorie drop column fk_statut; alter table llx_categorie add visible tinyint DEFAULT 1 NOT NULL; - +ALTER TABLE llx_categorie ADD UNIQUE INDEX uk_categorie_ref (label); alter table llx_c_actioncomm add module varchar(16) DEFAULT NULL after libelle; diff --git a/mysql/tables/llx_categorie.key.sql b/mysql/tables/llx_categorie.key.sql new file mode 100644 index 00000000000..9c2617ab70d --- /dev/null +++ b/mysql/tables/llx_categorie.key.sql @@ -0,0 +1,20 @@ +-- ============================================================================ +-- Copyright (C) 2007 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- ============================================================================ + +ALTER TABLE llx_categorie ADD UNIQUE INDEX uk_categorie_ref (label);