diff --git a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql index 2e194d17f2b..756d1312134 100644 --- a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql +++ b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql @@ -41,9 +41,19 @@ ALTER TABLE llx_expedition MODIFY date_expedition datetime; ALTER TABLE llx_expedition MODIFY date_delivery datetime NULL; ALTER TABLE llx_societe ADD COLUMN canvas varchar(32) DEFAULT NULL AFTER default_lang; ---UPDATE llx_societe SET canvas='default' WHERE canvas IS NULL; ---UPDATE llx_societe SET canvas='default' WHERE fk_typent <> 8; ---UPDATE llx_societe SET canvas='individual' WHERE fk_typent = 8; ALTER TABLE llx_cond_reglement RENAME TO llx_c_payment_term; ALTER TABLE llx_expedition_methode RENAME TO llx_c_shipment_mode; + +create table llx_element_rang +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_parent integer NOT NULL, + parenttype varchar(16) NOT NULL, + fk_child integer NOT NULL, + childtype varchar(16) NOT NULL, + rang integer DEFAULT 0 +) type=innodb; + +ALTER TABLE llx_element_rang ADD UNIQUE INDEX idx_element_rang_idx1 (fk_parent, parenttype, fk_child, childtype); +ALTER TABLE llx_element_rang ADD INDEX idx_element_rang_fk_parent (fk_parent); diff --git a/htdocs/install/mysql/tables/llx_element_rang.key.sql b/htdocs/install/mysql/tables/llx_element_rang.key.sql new file mode 100644 index 00000000000..8f8d8b2a09e --- /dev/null +++ b/htdocs/install/mysql/tables/llx_element_rang.key.sql @@ -0,0 +1,28 @@ +-- ============================================================================ +-- 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_element_rang ADD UNIQUE INDEX idx_element_rang_idx1 (fk_parent, parenttype, fk_child, childtype); + + +ALTER TABLE llx_element_rang ADD INDEX idx_element_rang_fk_parent (fk_parent); + +-- Pas de contraite sur fk_parent et fk_child car pointe sur differentes tables + \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_element_rang.sql b/htdocs/install/mysql/tables/llx_element_rang.sql new file mode 100644 index 00000000000..7e0dbb5dead --- /dev/null +++ b/htdocs/install/mysql/tables/llx_element_rang.sql @@ -0,0 +1,30 @@ +-- ============================================================================ +-- 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$ + + +create table llx_element_rang +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_parent integer NOT NULL, + parenttype varchar(16) NOT NULL, + fk_child integer NOT NULL, + childtype varchar(16) NOT NULL, + rang integer DEFAULT 0 +) type=innodb; +