Index: openacs-4/contrib/packages/survey/sql/oracle/upgrade/survey-upgrade-0.3d1-0.4.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/sql/oracle/upgrade/Attic/survey-upgrade-0.3d1-0.4.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/survey/sql/oracle/upgrade/survey-upgrade-0.3d1-0.4.sql 13 Jan 2004 20:23:04 -0000 1.1.2.1 @@ -0,0 +1,18 @@ +create table survey_block_sections ( + block_section_id integer primary key, + section_id integer + constraint survey_b_s_section_id_fk + references survey_sections, + answer_description varchar(400) +); + +insert into survey_block_sections(block_section_id, section_id, answer_description) + select distinct block_section_id, section_id, '' + from survey_block_questions bq + where not exists + (select block_section_id from survey_block_sections bs where + bs.block_section_id=bq.block_section_id); + +alter table survey_block_questions add constraint survey_block_sec_fk foreign key (block_section_id) references survey_block_sections; + +alter table survey_block_questions drop(section_id);