Index: openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql	14 Feb 2005 14:34:45 -0000	1.4
+++ openacs-4/packages/assessment/sql/postgresql/assessment-actions-create.sql	14 Feb 2005 17:17:25 -0000	1.5
@@ -10,6 +10,9 @@
 
 create table as_actions(
 	action_id	integer
+			constraint as_action_action_id_fk
+			references acs_objects(object_id)
+			on delete cascade
 			constraint as_actions_pk
 			primary key,
 	name		varchar(200),
@@ -120,7 +123,7 @@
 		now(),
 		new__creation_user,
 		null,
-		new__context_id,
+		new__package_id,
 		''t'',
 		null,
 		new__package_id
@@ -187,18 +190,18 @@
 Thank you,
 $administration_name"
 ns_sendmail "$email" "$admin_email" "You have been added as a user to [ad_system_name] at [ad_url]" "$message"'',
-	new__context_id,
+	new__package_id,
 	new__creation_user,
 	new__package_id
 	);
 
-v_parameter_id:= nextval(''as_action_params_parameter_id'')+6;
+v_parameter_id:= nextval(''as_action_params_parameter_id'');
 insert into as_action_params (parameter_id, action_id,type, varname, description) values (v_parameter_id,v_action_id,''n'',''first_names'',''First Names of the User'');
-v_parameter_id:= nextval(''as_action_params_parameter_id'')+6;
+v_parameter_id:= nextval(''as_action_params_parameter_id'');
 insert into as_action_params (parameter_id, action_id,type, varname, description) values (v_parameter_id,v_action_id,''n'',''last_name'',''Last Name of the User'');
-v_parameter_id:= nextval(''as_action_params_parameter_id'')+6;
+v_parameter_id:= nextval(''as_action_params_parameter_id'');
 insert into as_action_params (parameter_id, action_id,type, varname, description) values (v_parameter_id,v_action_id,''n'',''email'',''Email of the User'');
-v_parameter_id:= nextval(''as_action_params_parameter_id'')+6;
+v_parameter_id:= nextval(''as_action_params_parameter_id'');
 insert into as_action_params (parameter_id, action_id,type, varname, description) values (v_parameter_id,v_action_id,''n'',''user_name'',''User name of the User'');
 
 v_action_id:= as_action__new (
@@ -207,12 +210,12 @@
 	''Register user to event'',
 	''set user_id [ad_conn user_id]
 events::registration::new -event_id $event_id -user_id $user_id'',
-	new__context_id,
+	new__package_id,
 	new__creation_user,
 	new__package_id
 	);
 
-v_parameter_id:= nextval(''as_action_params_parameter_id'')+6;
+v_parameter_id:= nextval(''as_action_params_parameter_id'');
 insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (v_parameter_id,v_action_id,''q'',''event_id'',''Event to add the user'', ''select event_id,event_id from acs_events'');
 
 v_action_id:= as_action__new (
@@ -223,12 +226,12 @@
 dotlrn_privacy::set_user_guest_p -user_id $user_id -value "t"
 dotlrn::user_add -can_browse  -user_id $user_id
 dotlrn_community::add_user_to_community -community_id $community_id -user_id $user_id'',
-	new__context_id,
+	new__package_id,
 	new__creation_user,
 	new__package_id
 	);
 
-v_parameter_id:= nextval(''as_action_params_parameter_id'')+6;
+v_parameter_id:= nextval(''as_action_params_parameter_id'');
 insert into as_action_params (parameter_id, action_id,type, varname, description,query) values (v_parameter_id,v_action_id,''q'',''community_id'',''Community to add the user'', ''select pretty_name,community_id from dotlrn_communities'');
 
 	return v_action_id;
