From 78510c3eeabc5569f637af0ffad6a6a48340cff8 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Fri, 10 Aug 2012 16:02:07 +0200 Subject: [PATCH] Correct UPDATE statements to work with PostgreSQL. --- db/upgrade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/upgrade.php b/db/upgrade.php index 34c51fb..7af8cc6 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -271,7 +271,7 @@ function xmldb_attforblock_upgrade($oldversion=0) { $dbman->add_index($table, $index); } - $sql = "UPDATE {attendance_sessions} AS ses,{attforblock} AS att SET ses.attendanceid=att.id WHERE att.course=ses.courseid"; + $sql = "UPDATE {attendance_sessions} AS ses SET attendanceid=att.id FROM {attforblock} AS att WHERE att.course=ses.courseid"; $DB->execute($sql); $table = new xmldb_table('attendance_statuses'); @@ -287,7 +287,7 @@ function xmldb_attforblock_upgrade($oldversion=0) { $dbman->add_index($table, $index); } - $sql = "UPDATE {attendance_statuses} AS sta,{attforblock} AS att SET sta.attendanceid=att.id WHERE att.course=sta.courseid"; + $sql = "UPDATE {attendance_statuses} AS sta SET attendanceid=att.id FROM {attforblock} as att WHERE att.course=sta.courseid"; $DB->execute($sql); upgrade_mod_savepoint(true, 2010123003, 'attforblock');