Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Commit

Permalink
CONTRIB-4320 Corrected upgrade sql.
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan Reynolds authored and danmarsden committed Jul 3, 2013
1 parent 2b5bfc5 commit 1a0168d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ function xmldb_attforblock_upgrade($oldversion=0) {
$dbman->add_index($table, $index);
}

$sql = "UPDATE {attendance_sessions} AS ses SET attendanceid=att.id FROM {attforblock} AS att WHERE att.course=ses.courseid";
$sql = "UPDATE {attendance_sessions} AS ses
JOIN {attforblock} AS att
ON (ses.courseid = att.course)
SET ses.attendanceid=att.id";
$DB->execute($sql);

$table = new xmldb_table('attendance_statuses');
Expand All @@ -287,7 +290,10 @@ function xmldb_attforblock_upgrade($oldversion=0) {
$dbman->add_index($table, $index);
}

$sql = "UPDATE {attendance_statuses} AS sta SET attendanceid=att.id FROM {attforblock} as att WHERE att.course=sta.courseid";
$sql = "UPDATE {attendance_statuses} AS sta
JOIN {attforblock} as att
ON (sta.courseid = att.course)
SET sta.attendanceid = att.id";
$DB->execute($sql);

upgrade_mod_savepoint(true, 2010123003, 'attforblock');
Expand Down

0 comments on commit 1a0168d

Please sign in to comment.