From 1c20bbb2871808e3e6ee4d5ecf7874a3721c5f4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2017 12:07:32 +0200 Subject: [PATCH] NEW Add index and constraints keys on supplier proposal detail table --- .../install/mysql/migration/5.0.0-6.0.0.sql | 5 ++++ .../tables/llx_supplier_proposaldet.key.sql | 26 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_supplier_proposaldet.key.sql diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index e73c0df2add..9ff9de4e70d 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -173,4 +173,9 @@ create table llx_default_values ALTER TABLE llx_default_values ADD UNIQUE INDEX uk_default_values(type, entity, user_id, page, param); +ALTER TABLE llx_supplier_proposaldet ADD INDEX idx_supplier_proposaldet_fk_supplier_proposal (fk_supplier_proposal); +ALTER TABLE llx_supplier_proposaldet ADD INDEX idx_supplier_proposaldet_fk_product (fk_product); + +ALTER TABLE llx_supplier_proposaldet ADD CONSTRAINT fk_supplier_proposaldet_fk_unit FOREIGN KEY (fk_unit) REFERENCES llx_c_units (rowid); +ALTER TABLE llx_supplier_proposaldet ADD CONSTRAINT fk_supplier_proposaldet_fk_supplier_proposal FOREIGN KEY (fk_supplier_proposal) REFERENCES llx_supplier_proposal (rowid); diff --git a/htdocs/install/mysql/tables/llx_supplier_proposaldet.key.sql b/htdocs/install/mysql/tables/llx_supplier_proposaldet.key.sql new file mode 100644 index 00000000000..e6af3c7e515 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_supplier_proposaldet.key.sql @@ -0,0 +1,26 @@ +-- =================================================================== +-- Copyright (C) 2009-2011 Regis Houssin +-- Copyright (C) 2012 Cédric Salvador +-- +-- 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 ADD INDEX idx_supplier_proposaldet_fk_supplier_proposal (fk_supplier_proposal); +ALTER TABLE llx_supplier_proposaldet ADD INDEX idx_supplier_proposaldet_fk_product (fk_product); + +ALTER TABLE llx_supplier_proposaldet ADD CONSTRAINT fk_supplier_proposaldet_fk_unit FOREIGN KEY (fk_unit) REFERENCES llx_c_units (rowid); +ALTER TABLE llx_supplier_proposaldet ADD CONSTRAINT fk_supplier_proposaldet_fk_supplier_proposal FOREIGN KEY (fk_supplier_proposal) REFERENCES llx_supplier_proposal (rowid);