diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql index 1f34377e6ec6007cec078b40b254252d6261e34f..0705512893ed45660d8cd9b442bac67f78279abb 100755 --- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql +++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql @@ -226,7 +226,7 @@ create table llx_budget_lines ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_budget integer NOT NULL, - fk_project integer NOT NULL, + fk_project_ids varchar(255) NOT NULL, -- List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project "Projects to come". amount double(24,8) NOT NULL, datec datetime, tms timestamp, @@ -287,3 +287,23 @@ CREATE TABLE llx_opensurvey_user_formanswers ( ) ENGINE=InnoDB; + + +create table llx_categorie_project +( + fk_categorie integer NOT NULL, + fk_project integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; + +ALTER TABLE llx_categorie_project ADD PRIMARY KEY pk_categorie_project (fk_categorie, fk_project); +ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_categorie (fk_categorie); +ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_project (fk_project); + +ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); +ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_fk_project FOREIGN KEY (fk_project) REFERENCES llx_project (rowid); + + + + + diff --git a/htdocs/install/mysql/tables/llx_budget_lines.sql b/htdocs/install/mysql/tables/llx_budget_lines.sql index c5d3d3a4bf28f5ddfddd7e4c3a2a9d1c9e0ce4db..11b68f68fc454080f1fb9f1eb7b9ce8ebeb3f36f 100644 --- a/htdocs/install/mysql/tables/llx_budget_lines.sql +++ b/htdocs/install/mysql/tables/llx_budget_lines.sql @@ -18,13 +18,13 @@ create table llx_budget_lines ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_budget integer NOT NULL, - fk_project integer NOT NULL, - amount double(24,8) NOT NULL, - datec datetime, - tms timestamp, - fk_user_creat integer, - fk_user_modif integer, - import_key integer + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_budget integer NOT NULL, + fk_project_ids varchar(255) NOT NULL, -- 'IDS:x,y' = List of project ids related to this budget. If budget is dedicated to projects not yet started, we recommand to create a project "Projects to come". 'FILTER:x=y' = Can also be a dynamic rule to select projects. + amount double(24,8) NOT NULL, + datec datetime, + tms timestamp, + fk_user_creat integer, + fk_user_modif integer, + import_key integer )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_categorie_project.key.sql b/htdocs/install/mysql/tables/llx_categorie_project.key.sql new file mode 100644 index 0000000000000000000000000000000000000000..12532b6eb095aae16e6b8033eae1b619aecc9b24 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_categorie_project.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 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 <http://www.gnu.org/licenses/>. +-- +-- ============================================================================ + +ALTER TABLE llx_categorie_project ADD PRIMARY KEY pk_categorie_project (fk_categorie, fk_project); +ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_categorie (fk_categorie); +ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_project (fk_project); + +ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); +ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_fk_project FOREIGN KEY (fk_project) REFERENCES llx_project (rowid); diff --git a/htdocs/install/mysql/tables/llx_categorie_project.sql b/htdocs/install/mysql/tables/llx_categorie_project.sql new file mode 100644 index 0000000000000000000000000000000000000000..ca536822ac2bff84a41672771bff49243a29be06 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_categorie_project.sql @@ -0,0 +1,25 @@ +-- ============================================================================ +-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> +-- Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> +-- +-- 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 <http://www.gnu.org/licenses/>. +-- +-- ============================================================================ + +create table llx_categorie_project +( + fk_categorie integer NOT NULL, + fk_project integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb;