Index: openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql,v
diff -u -r1.59 -r1.60
--- openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql	24 Jul 2004 14:44:55 -0000	1.59
+++ openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql	22 Jan 2005 20:25:13 -0000	1.60
@@ -1667,11 +1667,6 @@
 	 v_instance_name := new__instance_name;
        end if;
 
-       update acs_objects
-       set title = v_instance_name,
-           package_id = v_package_id
-       where object_id = v_package_id;
-
        select package_type into v_package_type
        from apm_package_types
        where package_key = new__package_key;
@@ -1681,6 +1676,11 @@
        values
        (v_package_id, new__package_key, v_instance_name);
 
+       update acs_objects
+       set title = v_instance_name,
+           package_id = v_package_id
+       where object_id = v_package_id;
+
        if v_package_type = ''apm_application'' then
 	   insert into apm_applications
 	   (application_id)
