Index: openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql,v
diff -u -r1.18 -r1.19
--- openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql	12 Jun 2006 02:49:50 -0000	1.18
+++ openacs-4/packages/assessment/sql/postgresql/assessment-section-create.sql	15 May 2007 20:14:16 -0000	1.19
@@ -11,7 +11,8 @@
 				constraint as_section_display_types_id_pk
 				primary key
 				constraint as_section_display_types_id_fk
-				references cr_revisions(revision_id),
+				references cr_revisions(revision_id)
+                on delete cascade,
 	-- number of items displayed per page
 	num_items		integer,
 	-- adp template
@@ -38,10 +39,12 @@
 			constraint as_sections_section_id_pk
 			primary key
 			constraint as_sections_section_id_fk
-			references cr_revisions(revision_id),
+			references cr_revisions(revision_id)
+            on delete cascade,
 	display_type_id	integer
 			constraint as_sections_display_type_id_fk
-			references as_section_display_types (display_type_id),
+			references as_section_display_types (display_type_id)
+            on delete cascade,
 	-- text displayed on user pages
 	instructions	text,
 	-- number of items displayed
@@ -63,7 +66,8 @@
 			constraint as_assessments_assessment_id_pk
 			primary key
 			constraint as_assessments_assessment_id_fk
-			references cr_revisions(revision_id),
+			references cr_revisions(revision_id)
+            on delete cascade,
 	-- who is the "main" author and creator of this assessment
 	creator_id integer,
 	-- text that explains any specific steps the subject needs to follow
@@ -123,7 +127,7 @@
 	survey_p 	char(1) default 'f'
 			constraint as_assessments_survey_p_ck
 			check (survey_p in ('t', 'f')),
-	type		integer
+	type		varchar(1000)
 );
 
 -- Style Options 
@@ -149,10 +153,12 @@
 create table as_assessment_section_map (
 	assessment_id	integer
 			constraint as_assessment_section_map_assessment_id_fk
-			references as_assessments (assessment_id),
+			references as_assessments (assessment_id)
+            on delete cascade,
 	section_id	integer
 			constraint as_assessment_section_map_section_id_fk
-			references as_sections (section_id),
+			references as_sections (section_id)
+            on delete cascade,
 	-- maximum time to complete a section
 	max_time_to_complete	integer,
 	-- order in which a section will be displayed
@@ -169,10 +175,12 @@
 create table as_item_section_map (
 	as_item_id	integer
 			constraint as_item_section_map_item_id_fk
-			references as_items (as_item_id),
+			references as_items (as_item_id)
+            on delete cascade,
 	section_id	integer
 			constraint as_item_section_map_section_id_fk
-			references as_sections (section_id),
+			references as_sections (section_id)
+            on delete cascade,
 	-- whether Item must be answered
 	required_p	char(1) default 'f'
 			constraint as_item_section_map_required_p_ck
