Skip to content

Commit

Permalink
rating MDL-21657 changed inner joins to just joins
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Davis committed Mar 18, 2010
1 parent 61b0070 commit 09fa5f0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3095,25 +3095,25 @@ function xmldb_main_upgrade($oldversion) {
//forum ratings only have a single time column so use it for both time created and modified
$ratingssql = 'SELECT r.id AS rid, r.post AS itemid, r.rating, r.userid, r.time AS timecreated, r.time AS timemodified, f.scale, f.id AS mid
FROM {forum_ratings} r
INNER JOIN {forum_posts} p on p.id=r.post
INNER JOIN {forum_discussions} d on d.id=p.discussion
INNER JOIN {forum} f on f.id=d.forum';
JOIN {forum_posts} p on p.id=r.post
JOIN {forum_discussions} d on d.id=p.discussion
JOIN {forum} f on f.id=d.forum';
$result = $result && upgrade_module_ratings($ratingssql,'forum');

//migrate glossary_ratings
//glossary ratings only have a single time column so use it for both time created and modified
$ratingssql = 'SELECT r.id AS rid, r.entryid AS itemid, r.rating, r.userid, r.time AS timecreated, r.time AS timemodified, g.scale, g.id AS mid
FROM {glossary_ratings} r
INNER JOIN {glossary_entries} ge ON ge.id=r.entryid
INNER JOIN {glossary} g ON g.id=ge.glossaryid';
JOIN {glossary_entries} ge ON ge.id=r.entryid
JOIN {glossary} g ON g.id=ge.glossaryid';
$result = $result && upgrade_module_ratings($ratingssql,'glossary');

//migrate data_ratings
//data ratings didnt store time created and modified so Im using the times from the record the rating was attached to
$ratingssql = 'SELECT r.id AS rid, r.recordid AS itemid, r.rating, r.userid, re.timecreated, re.timemodified, d.scale, d.id AS mid
FROM {data_ratings} r
INNER JOIN {data_records} re ON r.recordid=re.id
INNER JOIN {data} d ON d.id=re.dataid';
JOIN {data_records} re ON r.recordid=re.id
JOIN {data} d ON d.id=re.dataid';
$result = $result && upgrade_module_ratings($ratingssql,'data');

//todo drop forum_ratings, data_ratings and glossary_ratings
Expand Down

0 comments on commit 09fa5f0

Please sign in to comment.