Index: openacs-4/packages/assessment/sql/postgresql/assessment-item-type-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-item-type-create.sql,v
diff -u -N -r1.10 -r1.11
--- openacs-4/packages/assessment/sql/postgresql/assessment-item-type-create.sql	12 Jun 2006 02:49:50 -0000	1.10
+++ openacs-4/packages/assessment/sql/postgresql/assessment-item-type-create.sql	15 May 2007 20:14:16 -0000	1.11
@@ -11,7 +11,8 @@
 				constraint as_item_type_mc_as_item_type_id_pk
 				primary key
 				constraint as_item_type_mc_as_item_type_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- (number of correct matches / number of total matches) *100% points. All or nothing will either give 100%, if all correct answers are given, or 0% else.
 	increasing_p		char(1) default 'f'
 				constraint as_item_type_mc_increasing_p_ck
@@ -32,7 +33,8 @@
 				constraint as_item_type_oq_as_item_type_id_pk
 				primary key
 				constraint as_item_type_oq_as_item_type_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- the content of this field will be prefilled in the response of the user taking the survey
 	default_value		varchar(500),
 	-- the person correcting the answers will see the contents of this box as correct answer for comparison with the user response
@@ -49,7 +51,8 @@
 				constraint as_item_display_rb_as_item_display_id_pk
 				primary key
 				constraint as_item_display_rb_as_item_display_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- field to specify other stuff like textarea dimensions 
 	html_display_options	varchar(50),
 	-- the pattern by which 2..n Item Choices are laid out when displayed (horizontal, vertical) 
@@ -68,7 +71,8 @@
 				constraint as_item_display_cb_as_item_display_id_pk
 				primary key
 				constraint as_item_display_cb_as_item_display_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- field to specify other stuff like textarea dimensions 
 	html_display_options	varchar(50),
 	-- the pattern by which 2..n Item Choices are laid out when displayed (horizontal, vertical) 
@@ -87,7 +91,8 @@
 				constraint as_item_display_sb_as_item_display_id_pk
 				primary key
 				constraint as_item_display_sb_as_item_display_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- field to specify other stuff like textarea dimensions 
 	html_display_options	varchar(50),
 	-- if multiple answers are allowed
@@ -111,7 +116,8 @@
 				constraint as_item_display_tb_as_item_display_id_pk
 				primary key
 				constraint as_item_display_tb_as_item_display_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- field to specify other stuff like textarea dimensions
 	html_display_options	varchar(50),
 	-- an abstraction of the real size value in "small","medium","large" 
@@ -126,7 +132,8 @@
 				constraint as_item_display_sa_as_item_display_id_pk
 				primary key
 				constraint as_item_display_sa_as_item_display_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- field to specify other stuff like textarea dimensions
 	html_display_options	varchar(50),
 	-- an abstraction of the real size value in "small","medium","large"
@@ -141,7 +148,8 @@
 				constraint as_item_type_sa_as_item_type_id_pk
 				primary key
 				constraint as_item_type_sa_as_item_type_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- (number of correct matches / number of total matches) *100% points. All or nothing will either give 100%, if all correct answers are given, or 0% else.
 	increasing_p		char(1) default 'f'
 				constraint as_item_type_sa_increasing_p_ck
@@ -158,7 +166,8 @@
 				constraint as_item_display_ta_as_item_display_id_pk
 				primary key
 				constraint as_item_display_ta_as_item_display_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- field to specify other stuff like textarea dimensions
 	html_display_options	varchar(50),
 	-- an abstraction of the real size value in "small","medium","large"
@@ -177,6 +186,7 @@
 				primary key
 				constraint as_item_type_fu_as_item_type_id_fk
 				references cr_revisions(revision_id)
+                on delete cascade
 );
 
 -- File Upload Display Type
@@ -185,7 +195,8 @@
 				constraint as_item_display_f_as_item_display_id_pk
 				primary key
 				constraint as_item_display_f_as_item_display_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- field to specify other stuff like textarea dimensions
 	html_display_options	varchar(50),
 	-- an abstraction of the real size value in "small","medium","large" 
