Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.0
-
Fix Version/s: 2.0
-
Component/s: Database SQL/XMLDB
-
Labels:None
-
Affected Branches:MOODLE_20_STABLE
-
Fixed Branches:MOODLE_20_STABLE
Description
Code to check that to current db schema matches install.xml.
Hey Andrei,
Couple things:
unset($dbfields[$fieldname]);
paired with:
foreach($dbfields as $fieldname=>$info) {
$errors[$tablename][] = 'Field ' . $fieldname . ' is unexpected.'
}
but for tables.
Other than that, it looks good to me.
- obviously I can see you have a TODO about localising strings
- You're checking for fields that exist in the database but not the schema, but not whole tables that exist in the database but not the schema. Perhaps you need to something similar to this:
unset($dbfields[$fieldname]); paired with: foreach($dbfields as $fieldname=>$info) { $errors[$tablename][] = 'Field ' . $fieldname . ' is unexpected.' } but for tables. Other than that, it looks good to me.