Index: openacs-4/packages/forums/sql/postgresql/forums-forums-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/sql/postgresql/forums-forums-drop.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/forums/sql/postgresql/forums-forums-drop.sql	1 Jun 2002 19:02:29 -0000	1.1
+++ openacs-4/packages/forums/sql/postgresql/forums-forums-drop.sql	12 Jun 2002 15:24:02 -0000	1.2
@@ -1,4 +1,3 @@
-
 --
 -- The Forums Package
 --
@@ -10,50 +9,56 @@
 --
 
 -- privileges
+
+create function inline_0 ()
+returns integer as '
 begin
-   -- temporarily drop this trigger to avoid a data-change violation 
-   -- on acs_privilege_hierarchy_index while updating the child privileges.
+    -- temporarily drop this trigger to avoid a data-change violation 
+    -- on acs_privilege_hierarchy_index while updating the child privileges.
+    drop trigger acs_priv_hier_ins_del_tr on acs_privilege_hierarchy;
 
-   drop trigger acs_priv_hier_ins_del_tr on acs_privilege_hierarchy;
+    -- remove children
+    perform acs_privilege__remove_child(''read'',''forum_read'');
+    perform acs_privilege__remove_child(''create'',''forum_create'');
+    perform acs_privilege__remove_child(''write'',''forum_write'');
+    perform acs_privilege__remove_child(''delete'',''forum_delete'');
+    perform acs_privilege__remove_child(''admin'',''forum_moderate'');
+    perform acs_privilege__remove_child(''forum_moderate'',''forum_read'');
+    perform acs_privilege__remove_child(''forum_moderate'',''forum_post'');
+    perform acs_privilege__remove_child(''forum_write'',''forum_read'');
 
-   -- remove children
-   select acs_privilege__remove_child('read','forum_read');
-   select acs_privilege__remove_child('create','forum_create');
-   select acs_privilege__remove_child('write','forum_write');
-   select acs_privilege__remove_child('delete','forum_delete');
-   select acs_privilege__remove_child('admin','forum_moderate');
-   select acs_privilege__remove_child('forum_moderate','forum_read');
-   select acs_privilege__remove_child('forum_moderate','forum_post');
-   select acs_privilege__remove_child('forum_write','forum_read');
+    -- reenable for trigger update
+    create trigger acs_priv_hier_ins_del_tr after insert or delete
+    on acs_privilege_hierarchy for each row
+    execute procedure acs_priv_hier_ins_del_tr ();
 
-   -- reenable for trigger update
-   create trigger acs_priv_hier_ins_del_tr after insert or delete
-   on acs_privilege_hierarchy for each row
-   execute procedure acs_priv_hier_ins_del_tr ();
+    perform acs_privilege__remove_child(''forum_write'',''forum_post'');
+    
+    perform acs_privilege__drop_privilege(''forum_moderate'');
+    perform acs_privilege__drop_privilege(''forum_post'');
+    perform acs_privilege__drop_privilege(''forum_read'');
+    perform acs_privilege__drop_privilege(''forum_create'');
+    perform acs_privilege__drop_privilege(''forum_write'');
+    perform acs_privilege__drop_privilege(''forum_delete'');
 
-   select acs_privilege__remove_child('forum_write','forum_post');
-   
-   select acs_privilege__drop_privilege('forum_moderate');
-   select acs_privilege__drop_privilege('forum_post');
-   select acs_privilege__drop_privilege('forum_read');
-   select acs_privilege__drop_privilege('forum_create');
-   select acs_privilege__drop_privilege('forum_write');
-   select acs_privilege__drop_privilege('forum_delete');
-end;
+    return null;
+end;' language 'plpgsql';
 
+select inline_0();
+drop function inline_0 ();
 
---
--- The Data Model
---
-
+drop view forums_forums_enabled;
 drop table forums_forums;
 
---
--- Object Type
---
-
+create function inline_0 ()
+returns integer as '
 begin
-        select acs_object_type__drop_type (
-            'forums_forum', 'f'
-        );
-end;
+    perform acs_object_type__drop_type (
+        ''forums_forum'', ''f''
+    );
+
+    return null;
+end;' language 'plpgsql';
+
+select inline_0();
+drop function inline_0 ();
