Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-drop.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql	15 Jun 2003 13:01:52 -0000	1.2
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-drop.sql	30 Jul 2003 20:42:05 -0000	1.3
@@ -26,17 +26,12 @@
         from   cr_items
         where  parent_id = v_folder_id
     LOOP
-       	PERFORM pm_project__delete_project_item(v_item_cursor.item_id);
+       	PERFORM pm_projects__delete_project_item(v_item_cursor.item_id);
     END LOOP;
 
     -- unregister_content_types
     PERFORM content_folder__unregister_content_type (
         v_folder_id,		-- folder_id
-        ''content_revision'',	-- content_type
-        ''t''			-- include_subtypes
-    );
-    PERFORM content_folder__unregister_content_type (
-        v_folder_id,		-- folder_id
         ''pm_project'',		-- content_type
         ''t''			-- include_subtypes
     );
@@ -54,27 +49,76 @@
 select inline_0();
 drop function inline_0();
 
--- drop package project-manager
---drop package, which drops all functions created with define_function_args
---select drop_package('pm_projects');
-drop function pm_project__name (integer);
-drop function pm_project__new_root_folder (integer);
-drop function pm_project__get_root_folder (integer);
-drop function pm_project__new_project_folder (varchar, varchar, integer, 
-	integer, varchar, integer);
-drop function pm_project__new_project_item (integer, varchar, varchar,
-	integer, varchar, varchar, char(1), timestamptz, timestamptz,
-	timestamptz, timestamptz, char(1), timestamptz, integer, 
-	varchar, integer);
-drop function pm_project__delete_project_item (integer);
-drop function pm_project__new_unique_name (integer);
+-----------
+-- PACKAGES
+-----------
 
 -- delete content_type 'pm_project'
-select acs_object_type__drop_type(
-	'pm_project',	-- object_type
-	't'		-- cascade_p
-    );
 
+create function inline_0 ()
+returns integer as '
+declare
+        v_pm_item       cr_items%ROWTYPE;
+begin
+        FOR v_pm_item in select
+                item_id
+                from
+                cr_items
+                where
+                content_type = ''pm_project''
+        LOOP
+                PERFORM pm_project__delete_project_item(v_pm_item.item_id);
+        END LOOP;
+        
+        return 0;
+end;
+' language 'plpgsql';
+
+select inline_0();
+drop function inline_0();
+
+-- drop package, which drops all functions created with define_function_args
+select drop_package('pm_project');
+
 --drop table
-drop table pm_projects;
-drop table pm_root_folders;
\ No newline at end of file
+drop table pm_projects cascade;
+
+select content_type__drop_type('pm_project', 't', 'f');
+
+--------
+-- TASKS
+--------
+
+
+create function inline_0 ()
+returns integer as '
+declare
+    v_item RECORD;
+        
+begin
+        for v_item in select 
+                item_id
+                from 
+                cr_items
+                where 
+                content_type = ''pm_task''
+        LOOP
+                
+                PERFORM pm_task__delete_task_item(v_item);
+        end loop;
+
+    return 0;
+end;
+' language 'plpgsql';
+
+-- select inline_0();
+drop function inline_0();
+
+select drop_package('pm_task');
+
+select content_type__drop_type('pm_task', 't', 'f');
+
+drop table pm_tasks cascade;
+drop table pm_tasks_revisions cascade;
+
+-- note that the Project Repository folder is not deleted
