From 7888b3d33ea817b0c93b43d880b7203dabf84580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Jan 2021 21:19:03 +0100 Subject: [PATCH 1/2] add missing index in extrafields tables of supplier proposal --- .../install/mysql/migration/13.0.0-14.0.0.sql | 35 ++++++++++--------- .../llx_supplier_proposal_extrafields.key.sql | 20 +++++++++++ ...x_supplier_proposaldet_extrafields.key.sql | 20 +++++++++++ 3 files changed, 59 insertions(+), 16 deletions(-) create mode 100644 htdocs/install/mysql/tables/llx_supplier_proposal_extrafields.key.sql create mode 100644 htdocs/install/mysql/tables/llx_supplier_proposaldet_extrafields.key.sql diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index fd65ab02827..a969cbc0564 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -30,6 +30,9 @@ -- Missing in v13 or lower +ALTER TABLE llx_supplier_proposal_extrafields ADD INDEX idx_supplier_proposal_extrafields (fk_object); +ALTER TABLE llx_supplier_proposaldet_extrafields ADD INDEX idx_supplier_proposaldet_extrafields (fk_object); + -- For v14 ALTER TABLE llx_c_availability ADD COLUMN position integer NOT NULL DEFAULT 0; @@ -63,21 +66,21 @@ ALTER TABLE llx_propal DROP FOREIGN KEY llx_propal_fk_warehouse; CREATE TABLE llx_workstation_workstation( -- BEGIN MODULEBUILDER FIELDS - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, ref varchar(128) DEFAULT '(PROV)' NOT NULL, label varchar(255), type varchar(7), note_public text, entity int DEFAULT 1, - note_private text, - date_creation datetime NOT NULL, - tms timestamp, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - import_key varchar(14), - status smallint NOT NULL, - nb_operators_required integer, - thm_operator_estimated double, + note_private text, + date_creation datetime NOT NULL, + tms timestamp, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), + status smallint NOT NULL, + nb_operators_required integer, + thm_operator_estimated double, thm_machine_estimated double -- END MODULEBUILDER FIELDS ) ENGINE=innodb; @@ -88,16 +91,16 @@ ALTER TABLE llx_workstation_workstation ADD CONSTRAINT fk_workstation_workstatio ALTER TABLE llx_workstation_workstation ADD INDEX idx_workstation_workstation_status (status); CREATE TABLE llx_workstation_workstation_resource( - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - tms timestamp, - fk_resource integer, + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + tms timestamp, + fk_resource integer, fk_workstation integer ) ENGINE=innodb; CREATE TABLE llx_workstation_workstation_usergroup( - rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, - tms timestamp, - fk_usergroup integer, + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + tms timestamp, + fk_usergroup integer, fk_workstation integer ) ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_supplier_proposal_extrafields.key.sql b/htdocs/install/mysql/tables/llx_supplier_proposal_extrafields.key.sql new file mode 100644 index 00000000000..4f365d85f55 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_supplier_proposal_extrafields.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- Copyright (C) 2021 Frédéric France +-- +-- 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_supplier_proposal_extrafields ADD INDEX idx_supplier_proposal_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_supplier_proposaldet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_supplier_proposaldet_extrafields.key.sql new file mode 100644 index 00000000000..278bda52c63 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_supplier_proposaldet_extrafields.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- Copyright (C) 2021 Frédéric France +-- +-- 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_supplier_proposaldet_extrafields ADD INDEX idx_supplier_proposaldet_extrafields (fk_object); From c77c5628caa9cd7dfda441981663c77b97086603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Jan 2021 21:35:30 +0100 Subject: [PATCH 2/2] add another missing undex --- .../install/mysql/migration/13.0.0-14.0.0.sql | 2 ++ .../tables/llx_asset_extrafields.key.sql | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_asset_extrafields.key.sql diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index a969cbc0564..287a568c646 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -33,6 +33,8 @@ ALTER TABLE llx_supplier_proposal_extrafields ADD INDEX idx_supplier_proposal_extrafields (fk_object); ALTER TABLE llx_supplier_proposaldet_extrafields ADD INDEX idx_supplier_proposaldet_extrafields (fk_object); +ALTER TABLE llx_asset_extrafields ADD INDEX idx_asset_extrafields (fk_object); + -- For v14 ALTER TABLE llx_c_availability ADD COLUMN position integer NOT NULL DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_asset_extrafields.key.sql b/htdocs/install/mysql/tables/llx_asset_extrafields.key.sql new file mode 100644 index 00000000000..fe6bb053ed6 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_asset_extrafields.key.sql @@ -0,0 +1,20 @@ +-- =================================================================== +-- Copyright (C) 2021 Frédéric France +-- +-- 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_asset_extrafields ADD INDEX idx_asset_extrafields (fk_object);