mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
merged fix for MDL-11909, putting a unique constraint userid-itemid on grade_grades table
This commit is contained in:
parent
2eb467b3b5
commit
1dda50ea08
3 changed files with 18 additions and 3 deletions
|
@ -2583,6 +2583,20 @@ function xmldb_main_upgrade($oldversion=0) {
|
|||
// Could not create the readme file. No cause for huge concern
|
||||
notify("Could not create the README.txt file in $readmefilename.");
|
||||
}
|
||||
}
|
||||
|
||||
if ($result && $oldversion < 2007101502) {
|
||||
|
||||
/// Define key userid-itemid (unique) to be added to grade_grades
|
||||
$table = new XMLDBTable('grade_grades');
|
||||
$key = new XMLDBKey('userid-itemid');
|
||||
$key->setAttributes(XMLDB_KEY_UNIQUE, array('userid', 'itemid'));
|
||||
|
||||
/// Launch add key userid-itemid
|
||||
$result = $result && add_key($table, $key);
|
||||
|
||||
/// Main savepoint reached
|
||||
upgrade_main_savepoint($result, 2007101502);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue