Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dbupdates/patch20140612.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dbupdates/patch20140612.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/dbupdates/patch20140612.sql 13 Jun 2014 00:49:49 -0000 1.1 @@ -0,0 +1,17 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3249 Removing old redundant question answers that had left from the times when autopatch created new question answers on each save +DELETE tl_laasse10_option_answer.* FROM tl_laasse10_question_result, tl_laasse10_option_answer + WHERE tl_laasse10_question_result.uid = tl_laasse10_option_answer.question_result_uid + AND tl_laasse10_question_result.result_uid IS NULL; +DELETE FROM tl_laasse10_question_result where result_uid IS NULL; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file