mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-11660 user_lastaccess cleanup
This commit is contained in:
parent
b51ece5b3b
commit
8600cadaea
2 changed files with 32 additions and 19 deletions
|
@ -2394,24 +2394,6 @@ function xmldb_main_upgrade($oldversion=0) {
|
|||
$result = $result && create_table($table);
|
||||
}
|
||||
|
||||
|
||||
/* NOTE: please keep this at the end of upgrade file for now ;-)
|
||||
/// drop old gradebook tables
|
||||
if ($result && $oldversion < xxxxxxxx) {
|
||||
$tables = array('grade_category',
|
||||
'grade_item',
|
||||
'grade_letter',
|
||||
'grade_preferences',
|
||||
'grade_exceptions');
|
||||
|
||||
foreach ($tables as $table) {
|
||||
$table = new XMLDBTable($table);
|
||||
if (table_exists($table)) {
|
||||
drop_table($table);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
// dropping context_rel table
|
||||
if ($result && $oldversion < 2007100800) {
|
||||
|
||||
|
@ -2437,6 +2419,37 @@ function xmldb_main_upgrade($oldversion=0) {
|
|||
$result = $result && add_index($table, $index);
|
||||
}
|
||||
|
||||
/// cleanup in user_lastaccess
|
||||
if ($result && $oldversion < 2007100902) {
|
||||
$sql = "DELETE
|
||||
FROM {$CFG->prefix}user_lastaccess
|
||||
WHERE NOT EXISTS (SELECT 'x'
|
||||
FROM {$CFG->prefix}course c
|
||||
WHERE c.id = {$CFG->prefix}user_lastaccess.courseid)";
|
||||
execute_sql($sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* NOTE: please keep this at the end of upgrade file for now ;-)
|
||||
/// drop old gradebook tables
|
||||
if ($result && $oldversion < xxxxxxxx) {
|
||||
$tables = array('grade_category',
|
||||
'grade_item',
|
||||
'grade_letter',
|
||||
'grade_preferences',
|
||||
'grade_exceptions');
|
||||
|
||||
foreach ($tables as $table) {
|
||||
$table = new XMLDBTable($table);
|
||||
if (table_exists($table)) {
|
||||
drop_table($table);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2007100805; // YYYYMMDD = date
|
||||
$version = 2007100902; // YYYYMMDD = date
|
||||
// XY = increments within a single day
|
||||
|
||||
$release = '1.9 Beta +'; // Human-friendly version name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue