Index: openacs-4/packages/chat/sql/postgresql/chat-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/sql/postgresql/chat-drop.sql,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/chat/sql/postgresql/chat-drop.sql	7 Aug 2017 23:48:07 -0000	1.5
+++ openacs-4/packages/chat/sql/postgresql/chat-drop.sql	3 Sep 2024 15:37:36 -0000	1.6
@@ -6,64 +6,18 @@
 -- @cvs-id $Id$
 --
 
-      --drop objects
-
-
-
 --
--- procedure inline_0/0
+-- Drop chat_room object types and tables
 --
-CREATE OR REPLACE FUNCTION inline_0(
+select acs_object_type__drop_type('chat_transcript','t', 't');
+select acs_object_type__drop_type('chat_room','t', 't');
 
-) RETURNS integer AS $$
-DECLARE
-	object_rec		record;
-BEGIN
-
-        for object_rec in select object_id from acs_objects where object_type='chat_transcript'
-	loop
-		PERFORM acs_object__delete( object_rec.object_id );
-	end loop;
-
-	for object_rec in select object_id from acs_objects where object_type='chat_room'
-	loop
-		PERFORM acs_object__delete( object_rec.object_id );
-	end loop;
-
-
-  return 0;
-END;
-$$ LANGUAGE plpgsql;
-
-select inline_0 ();
-drop function inline_0 ();
-
-
---
--- Drop chat_room object type
---
-
-
-
-
-select acs_object_type__drop_type('chat_room','t');
-select acs_object_type__drop_type('chat_transcript','t');
-
-drop   function chat_transcript__del (integer);
-
-drop   function chat_room__message_post (integer, varchar, integer, varchar);
-drop   function chat_room__delete_all_msgs (integer);
-drop   function chat_room__del (integer);
-
 drop table chat_msgs;
-drop table chat_transcripts;
-drop table chat_rooms;
 
 
 --
 -- Drop all chat privileges
 --
-
 CREATE OR REPLACE FUNCTION inline_0 () RETURNS integer AS $$
 BEGIN
 
@@ -92,11 +46,9 @@
  PERFORM acs_privilege__remove_child('chat_room_admin', 'chat_moderator_revoke');
  PERFORM acs_privilege__remove_child('chat_room_admin', 'chat_moderator');
 
- -- remove Site wite admin also administrator of the chat room
+ -- remove site-wide admin also administrator of the chat room
  PERFORM acs_privilege__remove_child('admin', 'chat_room_admin');
 
-
-
  PERFORM acs_privilege__drop_privilege('chat_room_create');
  PERFORM acs_privilege__drop_privilege('chat_room_view');
  PERFORM acs_privilege__drop_privilege('chat_room_edit');
@@ -119,7 +71,6 @@
  PERFORM acs_privilege__drop_privilege('chat_moderator');
  PERFORM acs_privilege__drop_privilege('chat_user');
 
-
   return 0;
 END;
 $$ LANGUAGE plpgsql;
