From 6f1c69ec02e38003d048f5697c55b7fa0a8f7b36 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 17 May 2006 06:25:46 +0000 Subject: [PATCH] mod/choice mod/lesson mod/scorm moodle16cleanup: Added notification for cleanup that may fail if one is starting fresh from moodle 1.5.3+, previous cleanup before 1.5.3 is not needed --- mod/choice/db/postgres7.php | 1 + mod/lesson/db/postgres7.php | 1 + mod/scorm/db/postgres7.php | 1 + 3 files changed, 3 insertions(+) diff --git a/mod/choice/db/postgres7.php b/mod/choice/db/postgres7.php index 041b80e13a5..7e71c2e53bb 100644 --- a/mod/choice/db/postgres7.php +++ b/mod/choice/db/postgres7.php @@ -93,6 +93,7 @@ function choice_upgrade($oldversion) { if ($oldversion < 2005041501) { // Mass cleanup of bad upgrade scripts modify_database('','CREATE INDEX prefix_choice_answers_choice_idx ON prefix_choice_answers (choiceid)'); + notify('The above error can be ignored if the index already exists, its possible that it was cleaned up already before running this upgrade'); modify_database('','ALTER TABLE prefix_choice ALTER display SET NOT NULL'); modify_database('','ALTER TABLE prefix_choice ALTER limitanswers SET NOT NULL'); modify_database('','ALTER TABLE prefix_choice_answers ALTER choiceid SET NOT NULL'); diff --git a/mod/lesson/db/postgres7.php b/mod/lesson/db/postgres7.php index 4d6c92287f0..fad2d9b161c 100644 --- a/mod/lesson/db/postgres7.php +++ b/mod/lesson/db/postgres7.php @@ -253,6 +253,7 @@ function lesson_upgrade($oldversion) { table_column('lesson','maxhighscores','maxhighscores','integer','16'); modify_database('','ALTER TABLE prefix_lesson ALTER displayleft SET NOT NULL'); table_column('lesson','','minquestions','integer','8'); + notify('The above error can be ignored if the column already exists, its possible that it was cleaned up already before running this upgrade'); table_column('lesson','maxtime','maxtime','integer','16'); modify_database('','ALTER TABLE prefix_lesson ALTER ongoing SET NOT NULL'); modify_database('','ALTER TABLE prefix_lesson ALTER password SET NOT NULL'); diff --git a/mod/scorm/db/postgres7.php b/mod/scorm/db/postgres7.php index 963fd264b75..9d6e4f24531 100755 --- a/mod/scorm/db/postgres7.php +++ b/mod/scorm/db/postgres7.php @@ -181,6 +181,7 @@ function scorm_upgrade($oldversion) { modify_database('','CREATE INDEX prefix_scorm_scoes_track_scorm_idx ON prefix_scorm_scoes_track (scormid);'); modify_database('','CREATE INDEX prefix_scorm_scoes_track_user_idx ON prefix_scorm_scoes_track (userid);'); modify_database('','CREATE INDEX prefix_scorm_scoes_track_sco_idx ON prefix_scorm_scoes_track (scoid);'); + notify('The above errors can be ignored if the indexes already exists, its possible that it was cleaned up already before running this upgrade'); execute_sql("DROP INDEX {$CFG->prefix}scorm_scoes_track_track_idx", false); modify_database('','ALTER TABLE ONLY prefix_scorm_scoes_track DROP CONSTRAINT prefix_scorm_scoes_track_pkey'); modify_database('','ALTER TABLE ONLY prefix_scorm_scoes_track ADD CONSTRAINT prefix_scorm_scoes_track_pkey PRIMARY KEY (id)');