Index: openacs-4/packages/contacts/sql/postgresql/upgrade/upgrade-1.0d3-1.0d4.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/upgrade/upgrade-1.0d3-1.0d4.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/contacts/sql/postgresql/upgrade/upgrade-1.0d3-1.0d4.sql	7 Jul 2005 18:52:38 -0000	1.2
+++ openacs-4/packages/contacts/sql/postgresql/upgrade/upgrade-1.0d3-1.0d4.sql	15 Jul 2005 21:01:52 -0000	1.3
@@ -6,11 +6,13 @@
 --
 --
 
+select define_function_args('acs_user__new','user_id,object_type;user,creation_date;now(),creation_user,creation_ip,authority_id,username,email,url,first_names,last_name,password,salt,screen_name,email_verified_p;t,context_id');
+
+
 alter table contact_rels drop column comment; 
 alter table contact_rels drop column comment_format;
 
 -- create contact application groups
-
 create or replace function contacts_upgrade_1d3_to_1d4 ()
 returns integer as '
 declare
@@ -34,6 +36,19 @@
   LOOP
 
         RAISE NOTICE ''NEW GROUP ID IS %'', package.new_group_id;
+	UPDATE ams_lists
+           SET list_name = to_char(package.package_id,''FM9999999999999999'') || ''__'' || to_char(package.new_group_id,''FM9999999999999999'')
+         WHERE list_name = to_char(package.package_id,''FM9999999999999999'') || ''__-2'';
+
+	UPDATE contact_search_conditions
+           SET var_list = ''in '' || to_char(package.new_group_id,''FM9999999999999999'')
+         WHERE list_name = ''in -2'';
+
+	UPDATE contact_search_conditions
+           SET var_list = ''not_in '' || to_char(package.new_group_id,''FM9999999999999999'')
+         WHERE list_name = ''not_in -2'';
+
+        RAISE NOTICE ''NEW GROUP ID IS %'', package.new_group_id;
         FOR member IN select distinct member_id, acs_object__name(member_id) as name from group_member_map where group_id = ''-2''
         LOOP
 
