diff --git a/htdocs/install/mysql/migration/2.7.0-2.8.0.sql b/htdocs/install/mysql/migration/2.7.0-2.8.0.sql index dfaa2b94a06..51256fecd27 100755 --- a/htdocs/install/mysql/migration/2.7.0-2.8.0.sql +++ b/htdocs/install/mysql/migration/2.7.0-2.8.0.sql @@ -168,4 +168,10 @@ create table llx_entity active tinyint DEFAULT 1 NOT NULL ) type=innodb; -INSERT INTO llx_entity (label, description, datec, fk_user_creat, visible, active) VALUES ('Default Entity', 'This is the default entity', NOW(), 1, 1, 1); \ No newline at end of file +INSERT INTO llx_entity (rowid, label, description, datec, fk_user_creat, visible, active) VALUES (1, 'Default Entity', 'This is the default entity', NOW(), 1, 1, 1); + +-- Add constraint +ALTER TABLE llx_fichinterdet ADD INDEX idx_fichinterdet_fk_fichinter (fk_fichinter); +ALTER TABLE llx_fichinterdet ADD CONSTRAINT fk_fichinterdet_fk_fichinter FOREIGN KEY (fk_fichinter) REFERENCES llx_fichinter (rowid); + + diff --git a/htdocs/install/mysql/tables/llx_fichinter.sql b/htdocs/install/mysql/tables/llx_fichinter.sql index dcc1c0be79a..284d9b1a555 100644 --- a/htdocs/install/mysql/tables/llx_fichinter.sql +++ b/htdocs/install/mysql/tables/llx_fichinter.sql @@ -34,7 +34,7 @@ create table llx_fichinter fk_user_author integer, -- createur de la fiche fk_user_valid integer, -- valideur de la fiche fk_statut smallint DEFAULT 0, - duree real, -- durée totale de l'intervention + duree real, -- duree totale de l'intervention description text, note_private text, note_public text, diff --git a/htdocs/install/mysql/tables/llx_fichinterdet.key.sql b/htdocs/install/mysql/tables/llx_fichinterdet.key.sql new file mode 100644 index 00000000000..9b0104ccfe5 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_fichinterdet.key.sql @@ -0,0 +1,23 @@ +-- =================================================================== +-- Copyright (C) 2010 Regis Houssin +-- +-- 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, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-- +-- $Id$ +-- =================================================================== + + +ALTER TABLE llx_fichinterdet ADD INDEX idx_fichinterdet_fk_fichinter (fk_fichinter); +ALTER TABLE llx_fichinterdet ADD CONSTRAINT fk_fichinterdet_fk_fichinter FOREIGN KEY (fk_fichinter) REFERENCES llx_fichinter (rowid);