From fcb00dbaf234b8c6a9c456f3cb4888c4e6b9649b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Oct 2016 16:53:33 +0200 Subject: [PATCH] Fix missing unique key --- htdocs/install/mysql/migration/4.0.0-5.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_accounting_account.key.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index 508e64b33cb..33a53a21763 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -118,3 +118,5 @@ create table llx_product_warehouse_properties ALTER TABLE llx_accounting_bookkeeping ADD COLUMN entity integer DEFAULT 1 NOT NULL; +ALTER TABLE llx_accounting_account ADD INDEX uk_accounting_account (account_number, entity); + diff --git a/htdocs/install/mysql/tables/llx_accounting_account.key.sql b/htdocs/install/mysql/tables/llx_accounting_account.key.sql index 93da3526e62..dcf57da5398 100644 --- a/htdocs/install/mysql/tables/llx_accounting_account.key.sql +++ b/htdocs/install/mysql/tables/llx_accounting_account.key.sql @@ -19,7 +19,7 @@ ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_fk_pcg_version (fk_pcg_version); -ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_account_number (account_number); +ALTER TABLE llx_accounting_account ADD INDEX uk_accounting_account (account_number, entity); -- This keys are created into foreign table after creation of foreign index