Skip to content

Commit

Permalink
MDL-71747 upgrade: remove all the < 3.9.0 upgrade steps
Browse files Browse the repository at this point in the history
This just deletes all the upgrade steps previous to 3.9.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2020061500 (v3.9.0) as anti-cheating measure.

The next commits will proceed to deprecate / remove functions
that were exclusively (usually belonging to upgradelib) being
used by those, now removed, upgrade steps. This is the list
of code to remove and document in upgrade.txt files:

  - upgrade_analytics_fix_contextids_defaults()
  - upgrade_convert_hub_config_site_param_names()
  - upgrade_rename_prediction_actions_useful_incorrectly_flagged()
  - \mod_forum\task\refresh_forum_post_counts adhoc task.

And these is the code that has NOT been removed
because it may be needed later (no matter there aren't uses now):

  - \core_search\manager::clean_up_non_existing_area(), used by
  - \core\task\clean_up_deleted_search_area_task adhoc task
  • Loading branch information
stronk7 committed Jul 7, 2022
1 parent 1a25935 commit 58b56e2
Show file tree
Hide file tree
Showing 110 changed files with 7 additions and 3,315 deletions.
9 changes: 0 additions & 9 deletions admin/tool/customlang/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@
function xmldb_tool_customlang_upgrade($oldversion) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions admin/tool/dataprivacy/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) {

$dbman = $DB->get_manager();

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions admin/tool/log/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@
function xmldb_tool_log_upgrade($oldversion) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
16 changes: 0 additions & 16 deletions admin/tool/log/store/database/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@
function xmldb_logstore_database_upgrade($oldversion) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

if ($oldversion < 2019032800) {
// For existing installations, set the new jsonformat option to off (no behaviour change).
// New installations default to on.
set_config('jsonformat', 0, 'logstore_database');
upgrade_plugin_savepoint(true, 2019032800, 'logstore', 'database');
}

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
16 changes: 0 additions & 16 deletions admin/tool/log/store/standard/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@
function xmldb_logstore_standard_upgrade($oldversion) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

if ($oldversion < 2019032800) {
// For existing installations, set the new jsonformat option to off (no behaviour change).
// New installations default to on.
set_config('jsonformat', 0, 'logstore_standard');
upgrade_plugin_savepoint(true, 2019032800, 'logstore', 'standard');
}

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
13 changes: 0 additions & 13 deletions admin/tool/mobile/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@
function xmldb_tool_mobile_upgrade($oldversion) {
global $CFG;

if ($oldversion < 2019021100) {
$disabledfeatures = get_config('tool_mobile', 'disabledfeatures');
$disabledfeatures = str_replace('remoteAddOn_', 'sitePlugin_', $disabledfeatures);
set_config('disabledfeatures', $disabledfeatures, 'tool_mobile');
upgrade_plugin_savepoint(true, 2019021100, 'tool', 'mobile');
}

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions admin/tool/monitor/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@
function xmldb_tool_monitor_upgrade($oldversion) {
global $CFG, $DB;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions admin/tool/policy/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@
function xmldb_tool_policy_upgrade($oldversion) {
global $DB;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions admin/tool/usertours/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ function xmldb_tool_usertours_upgrade($oldversion) {

$dbman = $DB->get_manager();

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions auth/cas/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
function xmldb_auth_cas_upgrade($oldversion) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions auth/db/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
function xmldb_auth_db_upgrade($oldversion) {
global $CFG, $DB;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions auth/email/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
function xmldb_auth_email_upgrade($oldversion) {
global $CFG, $DB;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions auth/ldap/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
function xmldb_auth_ldap_upgrade($oldversion) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions auth/manual/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
function xmldb_auth_manual_upgrade($oldversion) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions auth/mnet/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
function xmldb_auth_mnet_upgrade($oldversion) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions auth/none/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
function xmldb_auth_none_upgrade($oldversion) {
global $CFG, $DB;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
45 changes: 0 additions & 45 deletions auth/oauth2/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,51 +33,6 @@
function xmldb_auth_oauth2_upgrade($oldversion) {
global $DB;

$dbman = $DB->get_manager();

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

if ($oldversion < 2019052001) {
// Fetch Facebook, Google, and Microsoft issuers. We use the URL field to determine the issuer type as it's the only
// field that contains the keyword that can somewhat let us reliably determine the issuer type.
$likefacebook = $DB->sql_like('oe.url', ':facebook');
$likegoogle = $DB->sql_like('oe.url', ':google');
$likemicrosoft = $DB->sql_like('oe.url', ':microsoft');

$params = [
'facebook' => '%facebook%',
'google' => '%google%',
'microsoft' => '%microsoft%',
];

// We're querying from the oauth2_endpoint table because the base URLs of FB and Microsoft can be empty in the issuer table.
$subsql = "
SELECT DISTINCT oe.issuerid
FROM {oauth2_endpoint} oe
WHERE $likefacebook
OR $likegoogle
OR $likemicrosoft";

// Update non-Facebook/Google/Microsoft issuers and set requireconfirmation to 1.
$updatesql = "
UPDATE {oauth2_issuer}
SET requireconfirmation = 1
WHERE id NOT IN ({$subsql})";
$DB->execute($updatesql, $params);

// Delete linked logins for non-Facebook/Google/Microsoft issuers. They can easily re-link their logins anyway.
$DB->delete_records_select('auth_oauth2_linked_login', "issuerid NOT IN ($subsql)", $params);

upgrade_plugin_savepoint(true, 2019052001, 'auth', 'oauth2');
}

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions auth/shibboleth/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@
function xmldb_auth_shibboleth_upgrade($oldversion) {
global $CFG, $DB, $OUTPUT;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions blocks/badges/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@
function xmldb_block_badges_upgrade($oldversion, $block) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions blocks/calendar_month/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@
function xmldb_block_calendar_month_upgrade($oldversion, $block) {
global $CFG, $DB;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions blocks/calendar_upcoming/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@
function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
global $CFG;

// Automatically generated Moodle v3.6.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.7.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.8.0 release upgrade line.
// Put any upgrade step following this.

// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
Loading

0 comments on commit 58b56e2

Please sign in to comment.