Index: openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.5.0d2-2.5.0d3.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.5.0d2-2.5.0d3.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.5.0d2-2.5.0d3.sql	1 Feb 2009 21:56:45 -0000	1.1
+++ openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.5.0d2-2.5.0d3.sql	1 Nov 2013 21:08:30 -0000	1.2
@@ -1,22 +1,28 @@
 
-create or replace function dotlrn_community__new(integer,integer,varchar,varchar,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer)
-returns integer as '
+
+
+--
+-- procedure dotlrn_community__new/15
+--
+CREATE OR REPLACE FUNCTION dotlrn_community__new(
+   p_community_id integer,
+   p_parent_community_id integer,
+   p_community_type varchar,
+   p_community_key varchar,
+   p_pretty_name varchar,
+   p_description varchar,
+   p_archived_p varchar, -- default 'f'
+   p_portal_id integer,
+   p_non_member_portal_id integer,
+   p_package_id integer,
+   p_join_policy varchar,
+   p_creation_date timestamptz,
+   p_creation_user integer,
+   p_creation_ip varchar,
+   p_context_id integer
+
+) RETURNS integer AS $$
 DECLARE
-        p_community_id                  alias for $1;
-        p_parent_community_id           alias for $2;
-        p_community_type                alias for $3;
-        p_community_key                 alias for $4;
-        p_pretty_name                   alias for $5;
-        p_description                   alias for $6;
-        p_archived_p                    alias for $7;
-        p_portal_id                     alias for $8;
-        p_non_member_portal_id          alias for $9;
-        p_package_id                    alias for $10;
-        p_join_policy                   alias for $11;
-        p_creation_date                 alias for $12;
-        p_creation_user                 alias for $13;
-        p_creation_ip                   alias for $14;
-        p_context_id                    alias for $15;
         c_id                            integer;
         v_group_type_exists_p           integer;
 BEGIN
@@ -60,26 +66,35 @@
 
         return c_id;        
 END;
-' language 'plpgsql';
 
-create or replace function dotlrn_community_type__new (varchar,varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer)
-returns varchar as '
+$$ LANGUAGE plpgsql;
+
+
+
+-- added
+select define_function_args('dotlrn_community_type__new','community_type,parent_type,pretty_name,pretty_plural,description,package_id,creation_date,creation_user,creation_ip,context_id');
+
+--
+-- procedure dotlrn_community_type__new/10
+--
+CREATE OR REPLACE FUNCTION dotlrn_community_type__new(
+   p_community_type varchar,
+   p_parent_type varchar,
+   p_pretty_name varchar,
+   p_pretty_plural varchar,
+   p_description varchar,
+   p_package_id integer,
+   p_creation_date timestamptz,
+   p_creation_user integer,
+   p_creation_ip varchar,
+   p_context_id integer
+) RETURNS varchar AS $$
 DECLARE
-        p_community_type                        alias for $1;
-        p_parent_type                                alias for $2;
-        p_pretty_name                                alias for $3;
-        p_pretty_plural                                alias for $4;
-        p_description                                alias for $5;
-        p_package_id                                alias for $6;
-        p_creation_date                                alias for $7;
-        p_creation_user                                alias for $8;
-        p_creation_ip                                alias for $9;
-        p_context_id                                alias for $10;
         v_parent_object_type acs_object_types.object_type%TYPE;
         v_unique_name acs_objects.object_id%TYPE;
 BEGIN
         if p_parent_type is null then
-            v_parent_object_type:= ''application_group'';
+            v_parent_object_type:= 'application_group';
         else
             v_parent_object_type:= p_parent_type;
         end if;
@@ -96,16 +111,16 @@
             cast(v_unique_name as varchar),
             cast(v_unique_name as varchar),
             cast(v_unique_name as varchar),
-	    ''f'',
+	    'f',
 	    null,
-            ''acs_group.name''
+            'acs_group.name'
         );
 
         insert
         into group_types
         (group_type, default_join_policy)
         values
-        (p_community_type, ''closed'');
+        (p_community_type, 'closed');
 
         insert
         into dotlrn_community_types
@@ -123,28 +138,35 @@
 
         return p_community_type;
 END;
-' language 'plpgsql';
 
+$$ LANGUAGE plpgsql;
+
 select define_function_args('dotlrn_community__new','community_id,parent_community_id,community_type,community_key,pretty_name,description,archived_p;f,portal_id,non_member_portal_id,package_id,join_policy,creation_date,creation_user,creation_ip,context_id');
 
-create or replace function dotlrn_community__new(integer,integer,varchar,varchar,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer)
-returns integer as '
+
+
+--
+-- procedure dotlrn_community__new/15
+--
+CREATE OR REPLACE FUNCTION dotlrn_community__new(
+   p_community_id integer,
+   p_parent_community_id integer,
+   p_community_type varchar,
+   p_community_key varchar,
+   p_pretty_name varchar,
+   p_description varchar,
+   p_archived_p varchar, -- default 'f'
+   p_portal_id integer,
+   p_non_member_portal_id integer,
+   p_package_id integer,
+   p_join_policy varchar,
+   p_creation_date timestamptz,
+   p_creation_user integer,
+   p_creation_ip varchar,
+   p_context_id integer
+
+) RETURNS integer AS $$
 DECLARE
-        p_community_id                  alias for $1;
-        p_parent_community_id           alias for $2;
-        p_community_type                alias for $3;
-        p_community_key                 alias for $4;
-        p_pretty_name                   alias for $5;
-        p_description                   alias for $6;
-        p_archived_p                    alias for $7;
-        p_portal_id                     alias for $8;
-        p_non_member_portal_id          alias for $9;
-        p_package_id                    alias for $10;
-        p_join_policy                   alias for $11;
-        p_creation_date                 alias for $12;
-        p_creation_user                 alias for $13;
-        p_creation_ip                   alias for $14;
-        p_context_id                    alias for $15;
         c_id                            integer;
         v_group_type_exists_p           integer;
 BEGIN
@@ -188,5 +210,6 @@
 
         return c_id;        
 END;
-' language 'plpgsql';
 
+$$ LANGUAGE plpgsql;
+
