From 62b1d51be9eb4a24023a4fc1ea171df2f51f2474 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Thu, 22 Apr 2010 22:30:33 +0000 Subject: [PATCH] MDL-21657 Fixing regression - wrong SQL upgrade code Would be nice if core developers actually tried to run the code before they commit it into the repository. --- mod/forum/db/upgrade.php | 2 +- mod/glossary/db/upgrade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/forum/db/upgrade.php b/mod/forum/db/upgrade.php index 1252f2d3ab335..f87f9c61a722d 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -290,7 +290,7 @@ function xmldb_forum_upgrade($oldversion) { require_once($CFG->dirroot . '/lib/db/upgradelib.php'); //forum ratings only have a single time column so use it for both time created and modified - $sql = "INSERT {rating} (contextid, scaleid, itemid, rating, userid, timecreated, timemodified) + $sql = "INSERT INTO {rating} (contextid, scaleid, itemid, rating, userid, timecreated, timemodified) SELECT cxt.id, f.scale, r.post AS itemid, r.rating, r.userid, r.time AS timecreated, r.time AS timemodified FROM {forum_ratings} r JOIN {forum_posts} p ON p.id=r.post diff --git a/mod/glossary/db/upgrade.php b/mod/glossary/db/upgrade.php index 073fbd2e0b26d..32ecbb94cad89 100644 --- a/mod/glossary/db/upgrade.php +++ b/mod/glossary/db/upgrade.php @@ -265,7 +265,7 @@ function xmldb_glossary_upgrade($oldversion) { require_once($CFG->dirroot . '/lib/db/upgradelib.php'); //glossary ratings only have a single time column so use it for both time created and modified - $sql = "INSERT {rating} (contextid, scaleid, itemid, rating, userid, timecreated, timemodified) + $sql = "INSERT INTO {rating} (contextid, scaleid, itemid, rating, userid, timecreated, timemodified) SELECT cxt.id, g.scale, r.entryid AS itemid, r.rating, r.userid, r.time AS timecreated, r.time AS timemodified FROM {glossary_ratings} r JOIN {glossary_entries} ge ON ge.id=r.entryid