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.15.2.5 -r1.15.2.6
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql	4 Feb 2004 20:17:19 -0000	1.15.2.5
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-table-create.sql	5 Feb 2004 23:57:49 -0000	1.15.2.6
@@ -77,22 +77,10 @@
    'pm_project__name'           -- name_method
  );
 
--- this adds in the customer column. This is an example of how
--- the custom columns are added in. I put this here as a reminder
--- that other columns can be added in as well. These custom items
--- are in the custom-create.sql script
-select content_type__create_attribute(
-        'pm_project',
-        'customer_id',
-        'integer',
-        'Customer',
-        'Customers',
-        null,
-        null,
-        'integer constraint pm_project_customer_fk references organizations'
-);
 
+-- other fields are added in too. See the -custom script.
 
+
 -- ROLES
 
 create sequence pm_role_seq start 4;
@@ -172,6 +160,25 @@
 -- the information that we keep revisions on is in the 
 -- pm_task_revisions table, the rest is in pm_task
 
+create sequence pm_task_status_seq start 3;
+
+create table pm_task_status (
+        status_id               integer
+                                constraint pm_task_status_pk
+                                primary key,
+        description             varchar(100),
+        -- closed or open
+        status_type             char(1) default 'c'
+                                constraint pm_task_status_type_ck
+                                check (status_type in ('c','o'))
+);
+
+insert into pm_task_status (status_id, description, status_type) values
+(1, 'Open', 'o');
+insert into pm_task_status (status_id, description, status_type) values
+(2, 'Closed', 'c');
+
+
 create sequence pm_tasks_number_seq;
 
 create table pm_tasks (
@@ -181,7 +188,10 @@
                                         on delete cascade
                                         constraint pm_task_task_id_pk
                                         primary key,
-        task_number                     integer
+        task_number                     integer,
+        status                          integer
+                                        constraint pm_tasks_task_status_fk
+                                        references pm_task_status
 );
 
 
@@ -443,11 +453,31 @@
 );
 
 
-comment on table pm_project_assignment is '
-  Maps who is a part of what project, and in what capacity
+comment on table pm_task_assignment is '
+  Maps who is a part of what task, and in what capacity
 ';
 
+create table pm_task_xref (
+        task_id_1               integer
+                                constraint pm_task_xref_task1_nn
+                                not null
+                                constraint pm_task_xref_task1_fk
+                                references pm_tasks(task_id)
+                                on delete cascade,
+        task_id_2               integer
+                                constraint pm_task_xref_task2_nn
+                                not null
+                                constraint pm_task_xref_task2_fk
+                                references pm_tasks(task_id)
+                                on delete cascade,
+        constraint pm_task_xref_lt (task_id_1 < task_id_2)
+);
 
+comment on table pm_task_xref is '
+  Maps related tasks.
+';
+
+
 -- PROCESSES
 
 create sequence pm_process_seq;
