Index: openacs-4/packages/chat/sql/postgresql/upgrade/upgrade-5.0d4-5.0d5.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/sql/postgresql/upgrade/upgrade-5.0d4-5.0d5.sql,v
diff -u -N -r1.2 -r1.2.8.1
--- openacs-4/packages/chat/sql/postgresql/upgrade/upgrade-5.0d4-5.0d5.sql	24 Jun 2006 14:23:41 -0000	1.2
+++ openacs-4/packages/chat/sql/postgresql/upgrade/upgrade-5.0d4-5.0d5.sql	20 Jun 2016 09:00:22 -0000	1.2.8.1
@@ -12,19 +12,27 @@
 alter table chat_msgs drop column creation_date;
 alter table chat_msgs rename column creation_date2 to creation_date;
 
-create or replace function chat_room__edit (integer, varchar, varchar, boolean, boolean, boolean, boolean, boolean)
-returns integer as '
-declare
-   p_room_id        alias for $1;
-   p_pretty_name    alias for $2;
-   p_description    alias for $3;
-   p_moderated_p    alias for $4;
-   p_active_p       alias for $5;
-   p_archive_p      alias for $6;
-   p_auto_flush_p      alias for $7;
-   p_auto_transcript_p      alias for $8;
-begin
 
+
+-- added
+select define_function_args('chat_room__edit','room_id,pretty_name,description,moderated_p,active_p,archive_p,auto_flush_p,auto_transcript_p');
+
+--
+-- procedure chat_room__edit/8
+--
+CREATE OR REPLACE FUNCTION chat_room__edit(
+   p_room_id integer,
+   p_pretty_name varchar,
+   p_description varchar,
+   p_moderated_p boolean,
+   p_active_p boolean,
+   p_archive_p boolean,
+   p_auto_flush_p boolean,
+   p_auto_transcript_p boolean
+) RETURNS integer AS $$
+DECLARE
+BEGIN
+
         update chat_rooms set
             pretty_name = p_pretty_name,
             description = p_description,
@@ -36,29 +44,38 @@
         where
             room_id = p_room_id;
         return 0;
-end;' language 'plpgsql';
+END;
+$$ LANGUAGE plpgsql;
 
-create or replace function chat_room__new (integer, varchar, varchar, boolean, boolean, boolean, boolean, boolean, integer, timestamptz, integer, varchar, varchar)
-returns integer as '
-declare
-   p_room_id        alias for $1;
-   p_pretty_name    alias for $2;
-   p_description    alias for $3;
-   p_moderated_p    alias for $4;
-   p_active_p       alias for $5;
-   p_archive_p      alias for $6;
-   p_auto_flush_p      alias for $7;
-   p_auto_transcript_p      alias for $8;
-   p_context_id     alias for $9;
-   p_creation_date  alias for $10;
-   p_creation_user  alias for $11;
-   p_creation_ip    alias for $12;
-   p_object_type    alias for $13;
+
+
+-- added
+select define_function_args('chat_room__new','room_id,pretty_name,description,moderated_p,active_p,archive_p,auto_flush_p,auto_transcript_p,context_id,creation_date,creation_user,creation_ip,object_type');
+
+--
+-- procedure chat_room__new/13
+--
+CREATE OR REPLACE FUNCTION chat_room__new(
+   p_room_id integer,
+   p_pretty_name varchar,
+   p_description varchar,
+   p_moderated_p boolean,
+   p_active_p boolean,
+   p_archive_p boolean,
+   p_auto_flush_p boolean,
+   p_auto_transcript_p boolean,
+   p_context_id integer,
+   p_creation_date timestamptz,
+   p_creation_user integer,
+   p_creation_ip varchar,
+   p_object_type varchar
+) RETURNS integer AS $$
+DECLARE
    v_room_id        chat_rooms.room_id%TYPE;
-begin
+BEGIN
    v_room_id := acs_object__new (
      null,
-     ''chat_room'',
+     'chat_room',
      now(),
      p_creation_user,
      p_creation_ip,
@@ -72,5 +89,6 @@
 
 return v_room_id;
 
-end;' language 'plpgsql';
+END;
+$$ LANGUAGE plpgsql;
 
