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 8bd69792d88..a7add395e4c 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 @@ -464,12 +464,3 @@ UPDATE llx_product SET canvas = NULL where canvas = 'service@product'; DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'SOCIETE_CODECOMPTA_ADDON' AND __DECRYPT('value')__ = 'mod_codecompta_digitaria'; ALTER TABLE llx_c_barcode_type ADD UNIQUE INDEX uk_c_barcode_type(code, entity); - -ALTER TABLE llx_c_actioncomm DROP INDEX code, ADD UNIQUE uk_c_actioncomm (code); -ALTER TABLE llx_c_civilite DROP INDEX code, ADD UNIQUE uk_c_civilite (code); -ALTER TABLE llx_c_propalst DROP INDEX code, ADD UNIQUE uk_c_propalst (code); -ALTER TABLE llx_c_stcomm DROP INDEX code, ADD UNIQUE uk_c_stcomm (code); -ALTER TABLE llx_c_type_fees DROP INDEX code, ADD UNIQUE uk_c_type_fees (code); -ALTER TABLE llx_c_typent DROP INDEX code, ADD UNIQUE uk_c_typent (code); -ALTER TABLE llx_c_effectif DROP INDEX code, ADD UNIQUE uk_c_effectif (code); -ALTER TABLE llx_c_paiement DROP INDEX code, ADD UNIQUE uk_c_paiement (code); diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index a4ccf505059..57ed77a5126 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -790,3 +790,14 @@ ALTER TABLE llx_categorie MODIFY COLUMN label varchar(255) NOT NULL; ALTER TABLE llx_categorie ADD UNIQUE INDEX uk_categorie_ref (entity, fk_parent, label, type); ALTER TABLE llx_categorie ADD INDEX idx_categorie_type (type); ALTER TABLE llx_categorie ADD INDEX idx_categorie_label (label); + +-- Change index name to be compliant with SQL standard, index name must be unique in database schema +ALTER TABLE llx_c_actioncomm DROP INDEX code, ADD UNIQUE uk_c_actioncomm (code); +ALTER TABLE llx_c_civilite DROP INDEX code, ADD UNIQUE uk_c_civilite (code); +ALTER TABLE llx_c_propalst DROP INDEX code, ADD UNIQUE uk_c_propalst (code); +ALTER TABLE llx_c_stcomm DROP INDEX code, ADD UNIQUE uk_c_stcomm (code); +ALTER TABLE llx_c_type_fees DROP INDEX code, ADD UNIQUE uk_c_type_fees (code); +ALTER TABLE llx_c_typent DROP INDEX code, ADD UNIQUE uk_c_typent (code); +ALTER TABLE llx_c_effectif DROP INDEX code, ADD UNIQUE uk_c_effectif (code); +ALTER TABLE llx_c_paiement DROP INDEX code, ADD UNIQUE uk_c_paiement (code); + diff --git a/htdocs/install/mysql/tables/llx_c_actioncomm.key.sql b/htdocs/install/mysql/tables/llx_c_actioncomm.key.sql new file mode 100755 index 00000000000..b2ac7ad3662 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_actioncomm.key.sql @@ -0,0 +1,21 @@ +-- ======================================================================== +-- Copyright (C) 2004-2005 Rodolphe Quiedeville +-- Copyright (C) 2005-2009 Laurent Destailleur +-- Copyright (C) 2012 Florian Henry +-- +-- 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, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_actioncomm ADD UNIQUE INDEX uk_c_actioncomm(code); diff --git a/htdocs/install/mysql/tables/llx_c_actioncomm.sql b/htdocs/install/mysql/tables/llx_c_actioncomm.sql index a5b96b4ea10..6cf9653e5f1 100644 --- a/htdocs/install/mysql/tables/llx_c_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_c_actioncomm.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2002,2004 Rodolphe Quiedeville -- Copyright (C) 2004-2010 Laurent Destailleur +-- Copyright (C) 2012 Florian Henry -- -- 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 @@ -26,6 +27,5 @@ create table llx_c_actioncomm module varchar(16) DEFAULT NULL, active tinyint DEFAULT 1 NOT NULL, todo tinyint, - position integer NOT NULL DEFAULT 0, - UNIQUE KEY uk_c_actioncomm (code) + position integer NOT NULL DEFAULT 0 )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_civilite.key.sql b/htdocs/install/mysql/tables/llx_c_civilite.key.sql new file mode 100644 index 00000000000..dac2f39e437 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_civilite.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2012 Florian Henry +-- +-- 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, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_civilite ADD UNIQUE INDEX uk_c_civilite(code); diff --git a/htdocs/install/mysql/tables/llx_c_civilite.sql b/htdocs/install/mysql/tables/llx_c_civilite.sql index 65d6542cc5a..18fdad2ca94 100644 --- a/htdocs/install/mysql/tables/llx_c_civilite.sql +++ b/htdocs/install/mysql/tables/llx_c_civilite.sql @@ -23,7 +23,6 @@ create table llx_c_civilite code varchar(6) NOT NULL, civilite varchar(50), active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL, - UNIQUE KEY uk_c_civilite (code) + module varchar(32) NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_effectif.key.sql b/htdocs/install/mysql/tables/llx_c_effectif.key.sql new file mode 100644 index 00000000000..426ce9f4d0c --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_effectif.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2012 Florian Henry +-- +-- 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, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_effectif ADD UNIQUE INDEX uk_c_effectif(code); diff --git a/htdocs/install/mysql/tables/llx_c_effectif.sql b/htdocs/install/mysql/tables/llx_c_effectif.sql index ca3c64e710c..34ff9abd68d 100644 --- a/htdocs/install/mysql/tables/llx_c_effectif.sql +++ b/htdocs/install/mysql/tables/llx_c_effectif.sql @@ -23,7 +23,6 @@ create table llx_c_effectif code varchar(12) NOT NULL, libelle varchar(30), active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL, - UNIQUE KEY uk_c_effectif (code) + module varchar(32) NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_paiement.key.sql b/htdocs/install/mysql/tables/llx_c_paiement.key.sql new file mode 100644 index 00000000000..662843c4a60 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_paiement.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2012 Florian Henry +-- +-- 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, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement(code); diff --git a/htdocs/install/mysql/tables/llx_c_paiement.sql b/htdocs/install/mysql/tables/llx_c_paiement.sql index 5097d60f89e..5579db2a32a 100644 --- a/htdocs/install/mysql/tables/llx_c_paiement.sql +++ b/htdocs/install/mysql/tables/llx_c_paiement.sql @@ -31,8 +31,7 @@ create table llx_c_paiement libelle varchar(30), type smallint, active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL, - UNIQUE KEY uk_c_paiement (code) + module varchar(32) NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_propalst.key.sql b/htdocs/install/mysql/tables/llx_c_propalst.key.sql new file mode 100644 index 00000000000..5336f57b7d2 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_propalst.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2012 Florian Henry +-- +-- 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, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_propalst ADD UNIQUE INDEX uk_c_propalst(code); diff --git a/htdocs/install/mysql/tables/llx_c_propalst.sql b/htdocs/install/mysql/tables/llx_c_propalst.sql index 64b34f3c9ad..3c11aad7285 100644 --- a/htdocs/install/mysql/tables/llx_c_propalst.sql +++ b/htdocs/install/mysql/tables/llx_c_propalst.sql @@ -22,7 +22,6 @@ create table llx_c_propalst id smallint PRIMARY KEY, code varchar(12) NOT NULL, label varchar(30), - active tinyint DEFAULT 1 NOT NULL, - UNIQUE KEY uk_c_propalst (code) + active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_stcomm.key.sql b/htdocs/install/mysql/tables/llx_c_stcomm.key.sql new file mode 100644 index 00000000000..54b688bdb4f --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_stcomm.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2012 Florian Henry +-- +-- 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, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_stcomm ADD UNIQUE INDEX uk_c_stcomm(code); diff --git a/htdocs/install/mysql/tables/llx_c_stcomm.sql b/htdocs/install/mysql/tables/llx_c_stcomm.sql index 13616b8872b..8134eedea9d 100644 --- a/htdocs/install/mysql/tables/llx_c_stcomm.sql +++ b/htdocs/install/mysql/tables/llx_c_stcomm.sql @@ -22,7 +22,6 @@ create table llx_c_stcomm id integer PRIMARY KEY, code varchar(12) NOT NULL, libelle varchar(30), - active tinyint default 1 NOT NULL, - UNIQUE KEY uk_c_stcomm (code) + active tinyint default 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_type_fees.key.sql b/htdocs/install/mysql/tables/llx_c_type_fees.key.sql new file mode 100644 index 00000000000..2cb14835bad --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_type_fees.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2012 Florian Henry +-- +-- 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, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_type_fees ADD UNIQUE INDEX uk_c_type_fees(code); diff --git a/htdocs/install/mysql/tables/llx_c_type_fees.sql b/htdocs/install/mysql/tables/llx_c_type_fees.sql index f2154f475c6..6a70a6dce8f 100644 --- a/htdocs/install/mysql/tables/llx_c_type_fees.sql +++ b/htdocs/install/mysql/tables/llx_c_type_fees.sql @@ -23,6 +23,5 @@ create table llx_c_type_fees code varchar(12) NOT NULL, libelle varchar(30), active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL, - UNIQUE KEY uk_c_type_fees (code) + module varchar(32) NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_typent.key.sql b/htdocs/install/mysql/tables/llx_c_typent.key.sql new file mode 100644 index 00000000000..ac412c25d2e --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_typent.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2012 Florian Henry +-- +-- 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, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_typent ADD UNIQUE INDEX uk_c_typent(code); diff --git a/htdocs/install/mysql/tables/llx_c_typent.sql b/htdocs/install/mysql/tables/llx_c_typent.sql index 66c3c10bd41..4fb1c3c6cec 100644 --- a/htdocs/install/mysql/tables/llx_c_typent.sql +++ b/htdocs/install/mysql/tables/llx_c_typent.sql @@ -23,6 +23,5 @@ create table llx_c_typent code varchar(12) NOT NULL, libelle varchar(30), active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL, - UNIQUE KEY uk_c_typent (code) + module varchar(32) NULL )ENGINE=innodb;