From 950c0c2183963a32eba08f0ecd3094648fbbd57a Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Mon, 20 Jun 2022 09:15:19 +0200 Subject: [PATCH 1/4] Create llx_element_categorie.sql The goal of table llx_element_categorie is to replace all tables llx_categories_xxx (with one table). the llx_element_tag table initially intended for this does not have the correct nomenclature to express its real use (and was used for other things before) more informations here : https://github.com/Dolibarr/dolibarr/pull/21192 --- .../mysql/tables/llx_element_categorie.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_element_categorie.sql diff --git a/htdocs/install/mysql/tables/llx_element_categorie.sql b/htdocs/install/mysql/tables/llx_element_categorie.sql new file mode 100644 index 00000000000..a1c7fddb0eb --- /dev/null +++ b/htdocs/install/mysql/tables/llx_element_categorie.sql @@ -0,0 +1,25 @@ +-- ============================================================================ +-- Copyright (C) 2022 charlene Benke +-- +-- 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 3 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 . +-- +-- ============================================================================ + +create table llx_element_categorie +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_categorie integer NOT NULL, + fk_element integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; From e7858a97bf7c71cb3102b22c74de40a0535f4fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Thu, 23 Jun 2022 17:46:32 +0200 Subject: [PATCH 2/4] Delete llx_element_tag.sql --- .../install/mysql/tables/llx_element_tag.sql | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_element_tag.sql diff --git a/htdocs/install/mysql/tables/llx_element_tag.sql b/htdocs/install/mysql/tables/llx_element_tag.sql deleted file mode 100644 index d43ced98130..00000000000 --- a/htdocs/install/mysql/tables/llx_element_tag.sql +++ /dev/null @@ -1,25 +0,0 @@ --- ============================================================================ --- Copyright (C) 2021 Maxime Kohlhaas --- --- 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 3 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 . --- --- ============================================================================ - -create table llx_element_tag -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_categorie integer NOT NULL, - fk_element integer NOT NULL, - import_key varchar(14) -)ENGINE=innodb; From 7594c142360b82a4b483fe381653001bc54a3c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Thu, 23 Jun 2022 17:46:57 +0200 Subject: [PATCH 3/4] Delete llx_element_tag.key.sql --- .../mysql/tables/llx_element_tag.key.sql | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_element_tag.key.sql diff --git a/htdocs/install/mysql/tables/llx_element_tag.key.sql b/htdocs/install/mysql/tables/llx_element_tag.key.sql deleted file mode 100644 index d3a0b38afa9..00000000000 --- a/htdocs/install/mysql/tables/llx_element_tag.key.sql +++ /dev/null @@ -1,21 +0,0 @@ --- ============================================================================ --- Copyright (C) 2021 Maxime Kohlhaas --- --- 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 3 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_element_tag ADD UNIQUE INDEX idx_element_tag_uk (fk_categorie, fk_element); - -ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); From 986c241ee11c942dbc252dedbd988c20e281e611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Fri, 8 Jul 2022 08:09:40 +0200 Subject: [PATCH 4/4] create llx_element_categorie.key.sql --- .../tables/llx_element_categorie.key.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_element_categorie.key.sql diff --git a/htdocs/install/mysql/tables/llx_element_categorie.key.sql b/htdocs/install/mysql/tables/llx_element_categorie.key.sql new file mode 100644 index 00000000000..0367eddc0a1 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_element_categorie.key.sql @@ -0,0 +1,22 @@ +-- ============================================================================ +-- Copyright (C) 2022 Charlene Benke +-- +-- 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 3 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_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx1 (fk_element, fk_categorie); + +ALTER TABLE llx_element_contact ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_fk_categorie(rowid);