Incorrect variable name used for parameter.
[moodle-linuxchix.git] / mod / attendance / db / postgres7.php
blobb518d872c29e689ee03f85748998c8727a5c852e
1 <?php
3 function attendance_upgrade($oldversion) {
4 /// This function does anything necessary to upgrade
5 /// older versions to match current functionality
7 global $CFG;
9 //table_column($table, $oldfield, $field, $type="integer", $size="10",
10 // $signed="unsigned", $default="0", $null="not null", $after="")
13 if ($oldversion < 2003091802) {
14 table_column("attendance", "", "edited", "integer", 2, "unsigned", "0", "not null");
15 execute_sql("UPDATE {$CFG->prefix}attendance set edited = 1;");
17 if ($oldversion < 2003092500) {
18 table_column("attendance", "", "autoattend", "integer", 2, "unsigned", "0", "not null");
21 if ($oldversion < 2004050301) {
23 modify_database("", "INSERT INTO {$CFG->prefix}log_display VALUES ('attendance', 'view', 'attendance', 'name');");
25 modify_database("", "INSERT INTO {$CFG->prefix}log_display VALUES ('attendance', 'viewall', 'attendance', 'name');");
27 modify_database("", "INSERT INTO {$CFG->prefix}log_display VALUES ('attendance', 'viewweek', 'attendance', 'name');");
33 if ($oldversion < 2004111200) {
34 execute_sql("DROP INDEX {$CFG->prefix}attendance_course_idx;",false);
35 execute_sql("DROP INDEX {$CFG->prefix}attendance_roll_dayid_idx;",false);
36 execute_sql("DROP INDEX {$CFG->prefix}attendance_roll_userid_idx;",false);
38 modify_database('','CREATE INDEX prefix_attendance_course_idx ON prefix_attendance (course);');
39 modify_database('','CREATE INDEX prefix_attendance_roll_dayid_idx ON prefix_attendance_roll (dayid);');
40 modify_database('','CREATE INDEX prefix_attendance_roll_userid_idx ON prefix_attendance_roll (userid);');
43 return true;