Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-table-create.sql,v
diff -u -r1.6 -r1.7
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql	13 Aug 2003 18:56:29 -0000	1.6
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql	21 Aug 2003 22:34:43 -0000	1.7
@@ -34,7 +34,15 @@
 	actual_end_date		timestamptz,
 	ongoing_p		char(1) default 'f' 
 				constraint pm_projects_ongoing_p_ck
-				check (ongoing_p in ('t','f'))
+				check (ongoing_p in ('t','f')),
+        -- denormalized, computed values
+        -- these are computed but stored in projects table for efficient
+        -- access.
+        estimated_completion_date       timestamptz,
+        earlier_completion_date         timestamptz,
+        latest_completion_date          timestamptz,
+        actual_hours_completed          numeric,
+        estimated_hours_total           numeric
 );
 
 
@@ -136,10 +144,19 @@
                                         primary key,
         -- dates are optional, because it may be computed in reference
         -- to all other items, or simply not have a deadline
-        start_date                      timestamptz,
         end_date                        timestamptz,
         -- keep track of completion status
-        percent_complete                numeric
+        percent_complete                numeric,
+        -- PERT charts require minimum and maximum estimates
+        -- if we are not using these, then we set the min and max
+        -- estimates to the same value.
+        estimated_hours_work_min        numeric,
+        estimated_hours_work_max        numeric,
+        -- this should be computed by checking with logger? The actual
+        -- data should be in logger, logged by who did it, when etc..
+        -- or we can create a separate table to keep track of task hours
+        -- and make sure its data model is similar to logger? 
+        actual_hours_worked             numeric
 );
 
 -- create the content type
@@ -157,17 +174,6 @@
 
 select content_type__create_attribute (
     'pm_task', -- content_type
-    'start_date', -- attribute_name
-    'date',     -- datatype (string, number, boolean, date, keyword, integer)
-    'Start date', -- pretty_name
-    'Start dates', -- pretty_plural
-    null, -- sort_order
-    null, -- default value
-    'timestamptz' -- column_spec
-);
-
-select content_type__create_attribute (
-    'pm_task', -- content_type
     'end_date', -- attribute_name
     'date',     -- datatype
     'End date', -- pretty_name
@@ -188,8 +194,41 @@
     'numeric' -- column_spec
 );
 
+select content_type__create_attribute (
+    'pm_task', -- content_type
+    'estimated_hours_work_min', -- attribute_name
+    'number',           -- datatype
+    'Estimated minimum hours', -- pretty_name
+    'Estimated minimum hours', -- pretty_plural
+    null, -- sort_order
+    null, -- default value
+    'numeric' -- column_spec
+);
 
+select content_type__create_attribute (
+    'pm_task', -- content_type
+    'estimated_hours_work_max', -- attribute_name
+    'number',           -- datatype
+    'Estimated maximum hours', -- pretty_name
+    'Estimated maximum hours', -- pretty_plural
+    null, -- sort_order
+    null, -- default value
+    'numeric' -- column_spec
+);
 
+select content_type__create_attribute (
+    'pm_task', -- content_type
+    'actual_hours_worked', -- attribute_name
+    'number',           -- datatype
+    'Actual hours worked', -- pretty_name
+    'Actual hours worked', -- pretty_plural
+    null, -- sort_order
+    null, -- default value
+    'numeric' -- column_spec
+);
+
+
+
 -- constraint types
 -- such as:
 -- cannot start until Task X finishes
