Upgrading from Moodle 2.0 to 2.1 DB Error

Upgrading from Moodle 2.0 to 2.1 DB Error

by Michael Lowery -
Number of replies: 1

when i upgrade from moodle 2.0.3 to 2.1 i get a DB Ive gotten this error when upgraded 2 different instances on the same server,  any thoughts?

Debug info: Unknown column 'component' in 'where clause'
UPDATE mdl_rating
SET component = 'mod_data', ratingarea = 'entry'
WHERE contextid IN (
SELECT ctx.id
FROM mdl_context ctx
JOIN mdl_course_modules cm ON cm.id = ctx.instanceid
JOIN mdl_modules m ON m.id = cm.module
WHERE ctx.contextlevel = 70 AND
m.name = 'data'
) AND component = 'unknown'
[array (
)]
Stack trace:
line 396 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 707 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 336 of /mod/data/db/upgrade.php: call to mysqli_native_moodle_database->execute()
line 535 of /lib/upgradelib.php: call to xmldb_data_upgrade()
line 265 of /lib/upgradelib.php: call to upgrade_plugins_modules()
line 1460 of /lib/upgradelib.php: call to upgrade_plugins()
line 317 of /admin/index.php: call to upgrade_noncore()

Average of ratings: -
In reply to Michael Lowery

Re: Upgrading from Moodle 2.0 to 2.1 DB Error

by d morte -

Update: We checked the database and found that in our mdl_rating table, there is no compontent or ratingarea... So, we (Michael) added them with the type of varchar. If the Moodle upgrade had already been initiated and failed, adding these two columns only creates more errors. However, if the columns are added before the upgrade is attempted, the upgrade seems to work fine. Before we go and upgrade 20 instances of Moodle, does anyone have any thoughts on:

1. Why we would be missing these two parts of the mdl_rating table in the first place?

2. If simply adding these two pieces is a legitamate answer to the problem? In other words, aside from their creation, should other data be associated with them?