adding some strings
[moodle-linuxchix.git] / mod / exercise / db / postgres7.php
blobd77f49b8cee8af3487a7d6cb75b56ee7ac318f1b
1 <?php // $Id$
3 // THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
4 //
5 // IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
6 // LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
8 function exercise_upgrade($oldversion) {
9 // This function does anything necessary to upgrade
10 // older versions to match current functionality
12 global $CFG;
14 if ($oldversion < 2003121000) {
15 execute_sql(" ALTER TABLE `{$CFG->prefix}exercise_submissions` ADD `late` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'");
18 if ($oldversion < 2004062300) {
19 table_column("exercise", "", "gradinggrade", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL", "grade");
20 table_column("exercise", "", "assessmentcomps", "INTEGER", "4", "UNSIGNED", "2", "NOT NULL", "usemaximum");
23 if ($oldversion < 2004090200) {
24 table_column("exercise", "", "usepassword", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL");
25 table_column("exercise", "", "password", "VARCHAR", "32", "", "", "NOT NULL");
28 if ($oldversion < 2004091000) {
29 table_column("exercise_assessments","generalcomment","generalcomment","text","","","","NOT NULL");
30 table_column("exercise_assessments","teachercomment","teachercomment","text","","","","NOT NULL");
33 if ($oldversion < 2004100800) {
34 include_once("$CFG->dirroot/mod/exercise/lib.php");
35 exercise_refresh_events();
38 if ($oldversion < 2004111200) {
39 execute_sql("DROP INDEX {$CFG->prefix}exercise_course_idx;",false);
40 execute_sql("DROP INDEX {$CFG->prefix}exercise_submissions_exerciseid_idx;",false);
41 execute_sql("DROP INDEX {$CFG->prefix}exercise_assessments_exerciseid_idx;",false);
42 execute_sql("DROP INDEX {$CFG->prefix}exercise_rubrics_exerciseid_idx;",false);
43 execute_sql("DROP INDEX {$CFG->prefix}exercise_grades_exerciseid_idx;",false);
45 modify_database('','CREATE INDEX prefix_exercise_course_idx ON prefix_exercise (course);');
46 modify_database('','CREATE INDEX prefix_exercise_submissions_exerciseid_idx ON prefix_exercise_submissions (exerciseid);');
47 modify_database('','CREATE INDEX prefix_exercise_assessments_exerciseid_idx ON prefix_exercise_assessments (exerciseid);');
48 modify_database('','CREATE INDEX prefix_exercise_rubrics_exerciseid_idx ON prefix_exercise_rubrics (exerciseid);');
49 modify_database('','CREATE INDEX prefix_exercise_grades_exerciseid_idx ON prefix_exercise_grades (exerciseid);');
52 ////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.
54 return true;