From f3a56f8acd4be9a25913fd4efd703a7f33b04543 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Feb 2010 17:36:02 +0000 Subject: [PATCH] Works on enhancement of project tasks Add project milestone --- .../install/mysql/migration/2.7.0-2.8.0.sql | 25 +++++++++++++- .../mysql/tables/llx_projet_milestone.key.sql | 27 +++++++++++++++ .../mysql/tables/llx_projet_milestone.sql | 34 +++++++++++++++++++ .../install/mysql/tables/llx_projet_task.sql | 1 + 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 htdocs/install/mysql/tables/llx_projet_milestone.key.sql create mode 100644 htdocs/install/mysql/tables/llx_projet_milestone.sql 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 a3e07ff8847..67d35fe795b 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 @@ -89,7 +89,7 @@ create table llx_extra_fields_values ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, - entity integer DEFAULT 1 NOT NULL, -- multi company id + entity integer DEFAULT 1 NOT NULL, datec datetime, datem datetime, fk_object integer NOT NULL, @@ -123,6 +123,7 @@ ALTER TABLE llx_projet_task MODIFY description text; ALTER TABLE llx_projet_task MODIFY duration_effective real DEFAULT 0 NOT NULL; ALTER TABLE llx_projet_task ADD COLUMN progress integer DEFAULT 0 AFTER duration_effective; ALTER TABLE llx_projet_task ADD COLUMN priority integer DEFAULT 0 AFTER progress; +ALTER TABLE llx_projet_task ADD COLUMN fk_milestone integer DEFAULT 0 AFTER priority; ALTER TABLE llx_projet_task ADD COLUMN fk_user_modif integer AFTER fk_user_creat; ALTER TABLE llx_projet_task ADD COLUMN fk_user_valid integer AFTER fk_user_modif; UPDATE llx_projet_task SET statut='1' WHERE statut='open'; @@ -164,6 +165,28 @@ ALTER TABLE llx_projet ADD COLUMN note_public text AFTER note_private; ALTER TABLE llx_projet MODIFY fk_statut smallint DEFAULT 0 NOT NULL; ALTER TABLE llx_projet MODIFY fk_user_creat integer NOT NULL; +-- Add project milestone +create table llx_projet_milestone +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_projet integer NOT NULL, + label varchar(255) NOT NULL, + description text, + datec datetime, + tms timestamp, + dateo datetime, + datee datetime, + priority integer DEFAULT 0, + fk_user_creat integer, + rang integer DEFAULT 0 +)type=innodb; + +ALTER TABLE llx_projet_milestone ADD INDEX idx_projet_milestone_fk_projet (fk_projet); +ALTER TABLE llx_projet_milestone ADD INDEX idx_projet_milestone_fk_user_creat (fk_user_creat); + +ALTER TABLE llx_projet_milestone ADD CONSTRAINT fk_projet_milestone_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); +ALTER TABLE llx_projet_milestone ADD CONSTRAINT fk_projet_milestone_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid); + -- Uniformize code: change tva_taux to tva_tx ALTER TABLE llx_facturedet CHANGE tva_taux tva_tx real; ALTER TABLE llx_facture_fourn_det CHANGE tva_taux tva_tx double(6,3); diff --git a/htdocs/install/mysql/tables/llx_projet_milestone.key.sql b/htdocs/install/mysql/tables/llx_projet_milestone.key.sql new file mode 100644 index 00000000000..61ccc154a81 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_projet_milestone.key.sql @@ -0,0 +1,27 @@ +-- ============================================================================ +-- 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_projet_milestone ADD INDEX idx_projet_milestone_fk_projet (fk_projet); +ALTER TABLE llx_projet_milestone ADD INDEX idx_projet_milestone_fk_user_creat (fk_user_creat); + +ALTER TABLE llx_projet_milestone ADD CONSTRAINT fk_projet_milestone_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); +ALTER TABLE llx_projet_milestone ADD CONSTRAINT fk_projet_milestone_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_projet_milestone.sql b/htdocs/install/mysql/tables/llx_projet_milestone.sql new file mode 100644 index 00000000000..6c0652e04c9 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_projet_milestone.sql @@ -0,0 +1,34 @@ +-- =========================================================================== +-- 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_projet_milestone +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_projet integer NOT NULL, + label varchar(255) NOT NULL, + description text, + datec datetime, -- date creation + tms timestamp, -- date creation/modification + dateo datetime, -- date start milestone + datee datetime, -- date end milestone + priority integer DEFAULT 0, -- priority + fk_user_creat integer, -- user who created the task + rang integer DEFAULT 0 +)type=innodb; diff --git a/htdocs/install/mysql/tables/llx_projet_task.sql b/htdocs/install/mysql/tables/llx_projet_task.sql index ca28fcb5a6d..50e0b5729df 100644 --- a/htdocs/install/mysql/tables/llx_projet_task.sql +++ b/htdocs/install/mysql/tables/llx_projet_task.sql @@ -34,6 +34,7 @@ create table llx_projet_task duration_effective real DEFAULT 0 NOT NULL, progress integer DEFAULT 0, -- percentage increase priority integer DEFAULT 0, -- priority + fk_milestone integer DEFAULT 0, -- milestone fk_user_creat integer, -- user who created the task fk_user_valid integer, -- user who validated the task fk_statut smallint DEFAULT 0 NOT NULL,