MDL-43797 lib/db/upgrade.php: Remove custom pages for deleted users

Change-Id: Ifef563431682a2a5524927f85ca9eba9cbe520ff
This commit is contained in:
David Curry 2014-01-23 10:56:47 +13:00
parent 72d1ccffb3
commit a5ab83ac5e
2 changed files with 14 additions and 1 deletions

View File

@ -2927,5 +2927,18 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2014011701.00);
}
if ($oldversion < 2014012300.01) {
// Remove deleted users home pages.
$active = $DB->get_fieldset_select('user', 'id', 'deleted = ?', array(0));
list($insql, $params) = $DB->get_in_or_equal($active, SQL_PARAMS_QM, 'param', false);
$sql = 'DELETE FROM {my_pages}
WHERE userid ' . $insql;
$DB->execute($sql, $params);
// Reached main savepoint.
upgrade_main_savepoint(true, 2014012300.01);
}
return true;
}

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2014012300.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2014012300.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.