Skip to content
Browse files

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

Change-Id: Ifef563431682a2a5524927f85ca9eba9cbe520ff
  • Loading branch information...
1 parent 72d1ccf commit a5ab83ac5ee79bf1b2e3f3fb6ea2e93f7e099273 @DavidCurry DavidCurry committed Jan 23, 2014
Showing with 14 additions and 1 deletion.
  1. +13 −0 lib/db/upgrade.php
  2. +1 −1 version.php
View
13 lib/db/upgrade.php
@@ -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
2 version.php
@@ -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.

0 comments on commit a5ab83a

Please sign in to comment.
Something went wrong with that request. Please try again.