Skip to content

Commit

Permalink
Fix: Primary keys must be named
Browse files Browse the repository at this point in the history
Fix: Added missing constraints/index for suppliers categories
  • Loading branch information
eldy committed Jan 2, 2012
1 parent 6f63c5e commit 439af32
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
24 changes: 24 additions & 0 deletions htdocs/install/mysql/tables/llx_categorie_fournisseur.key.sql
@@ -0,0 +1,24 @@
-- ============================================================================
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
--
-- 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 <http://www.gnu.org/licenses/>.
--
-- ============================================================================

ALTER TABLE llx_categorie_fournisseur ADD PRIMARY KEY pk_categorie_fournisseur (fk_categorie, fk_societe);
ALTER TABLE llx_categorie_fournisseur ADD INDEX idx_categorie_fournisseur_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_fournisseur ADD INDEX idx_categorie_fournisseur_fk_societe (fk_societe);

ALTER TABLE llx_categorie_fournisseur ADD CONSTRAINT fk_categorie_fournisseur_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_fournisseur ADD CONSTRAINT fk_categorie_fournisseur_fk_soc FOREIGN KEY (fk_societe) REFERENCES llx_societe (rowid);
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_categorie_member.key.sql
Expand Up @@ -18,7 +18,7 @@
--
-- ============================================================================

ALTER TABLE llx_categorie_member ADD PRIMARY KEY (fk_categorie, fk_member);
ALTER TABLE llx_categorie_member ADD PRIMARY KEY pk_categorie_member (fk_categorie, fk_member);
ALTER TABLE llx_categorie_member ADD INDEX idx_categorie_member_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_member ADD INDEX idx_categorie_member_fk_member (fk_member);

Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_categorie_product.key.sql
Expand Up @@ -18,7 +18,7 @@
--
-- ============================================================================

ALTER TABLE llx_categorie_product ADD PRIMARY KEY (fk_categorie, fk_product);
ALTER TABLE llx_categorie_product ADD PRIMARY KEY pk_categorie_product (fk_categorie, fk_product);
ALTER TABLE llx_categorie_product ADD INDEX idx_categorie_product_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_product ADD INDEX idx_categorie_product_fk_product (fk_product);

Expand Down
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_categorie_societe.key.sql
Expand Up @@ -16,7 +16,7 @@
--
-- ============================================================================

ALTER TABLE llx_categorie_societe ADD PRIMARY KEY (fk_categorie, fk_societe);
ALTER TABLE llx_categorie_societe ADD PRIMARY KEY pk_categorie_societe (fk_categorie, fk_societe);
ALTER TABLE llx_categorie_societe ADD INDEX idx_categorie_societe_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_societe ADD INDEX idx_categorie_societe_fk_societe (fk_societe);

Expand Down

0 comments on commit 439af32

Please sign in to comment.