From 0c2d9d9db7cd09c2c8d1c2c47c61f032d1beb04e Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sun, 10 Jan 2021 23:32:04 +0100 Subject: [PATCH 1/5] MDL-69308 environment: 3.11 base information This is a direct copy of the 3.10 branch to have the changes under control in next commits. --- admin/environment.xml | 181 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) diff --git a/admin/environment.xml b/admin/environment.xml index 3c6365fba8b..47ee604e1b8 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -3344,4 +3344,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c6fb18ef1d05f385ebb43938b90322b84d5ed74f Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sun, 10 Jan 2021 23:38:34 +0100 Subject: [PATCH 2/5] MDL-69308 environment: Apply agreed changes - PHP 7.3 required. - Moodle 3.6 required. - SQL*Server 2017 (aka, 14.0) required. - Sodium PHP extension required. --- admin/environment.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/admin/environment.xml b/admin/environment.xml index 47ee604e1b8..857a8d37ca9 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -3344,7 +3344,7 @@ - + @@ -3354,10 +3354,10 @@ - + - + @@ -3444,6 +3444,7 @@ + From 0f7aafe1fe45acc0dac931bb04a09607a6fe65e4 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sun, 10 Jan 2021 23:42:52 +0100 Subject: [PATCH 3/5] MDL-69308 travis: Bump min PHP requirement to 7.3 --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 796d0452652..a8fc7c32acc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,18 +26,18 @@ jobs: fast_finish: true include: - # First all the lowest php ones (7.2) - - php: 7.2 + # First all the lowest php ones (7.3) + - php: 7.3 env: DB=none TASK=CITEST - - php: 7.2 + - php: 7.3 env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon' - if: env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present - php: 7.2 + php: 7.3 env: DB=pgsql TASK=PHPUNIT - if: env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all" - php: 7.2 + php: 7.3 env: DB=mysqli TASK=PHPUNIT # Then, conditionally, all the highest php ones (7.4) From aff5b5abb9cc9dd6df27fe170f101627068876e5 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sun, 10 Jan 2021 23:44:47 +0100 Subject: [PATCH 4/5] MDL-69308 github actions: Bump min PHP requirement to 7.3 --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f063803e4a7..35fd4a766bb 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -48,7 +48,7 @@ jobs: matrix: include: - os: ubuntu-18.04 - php: 7.2 + php: 7.3 db: mysqli - os: ubuntu-18.04 php: 7.4 From 5aed7f4217b4ce57ee0ce4074e49d23f0ad813a3 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 13 Jan 2021 19:11:19 +0100 Subject: [PATCH 5/5] MDL-69308 upgrade: remove all the < 3.6.0 upgrade steps This just deletes all the upgrade steps previous to 3.6.0. Some small adjustments, like tweaking globals can also be applied when needed. Also includes an upgrade step to prevent upgrading from any version < 2018120300 (v3.6.0) as anti-cheating measure. Note that in this case, there wasn't any case of upgradelib functions being used, hence we haven't to deprecate/remove anything in codebase. When there is such a need, that is done in separate commits (one for each function) and documented here. See MDL-65809 commits for an example removing/deprecating a good number of functions. --- admin/tool/customlang/db/upgrade.php | 3 - admin/tool/dataprivacy/db/upgrade.php | 278 -------- admin/tool/log/db/upgrade.php | 3 - admin/tool/log/store/database/db/upgrade.php | 3 - admin/tool/log/store/standard/db/upgrade.php | 3 - admin/tool/monitor/db/upgrade.php | 3 - admin/tool/policy/db/upgrade.php | 26 - admin/tool/usertours/db/upgrade.php | 3 - auth/cas/db/upgrade.php | 3 - auth/db/db/upgrade.php | 3 - auth/email/db/upgrade.php | 3 - auth/ldap/db/upgrade.php | 3 - auth/manual/db/upgrade.php | 3 - auth/mnet/db/upgrade.php | 3 - auth/none/db/upgrade.php | 3 - auth/oauth2/db/upgrade.php | 3 - auth/shibboleth/db/upgrade.php | 3 - blocks/badges/db/upgrade.php | 3 - blocks/calendar_month/db/upgrade.php | 3 - blocks/calendar_upcoming/db/upgrade.php | 3 - blocks/completionstatus/db/upgrade.php | 3 - blocks/course_summary/db/upgrade.php | 3 - blocks/html/db/upgrade.php | 3 - blocks/navigation/db/upgrade.php | 3 - blocks/quiz_results/db/upgrade.php | 3 - blocks/recent_activity/db/upgrade.php | 3 - blocks/rss_client/db/upgrade.php | 3 - blocks/section_links/db/upgrade.php | 3 - blocks/selfcompletion/db/upgrade.php | 3 - blocks/settings/db/upgrade.php | 3 - course/format/topics/db/upgrade.php | 3 - course/format/weeks/db/upgrade.php | 3 - enrol/database/db/upgrade.php | 3 - enrol/flatfile/db/upgrade.php | 3 - enrol/guest/db/upgrade.php | 3 - enrol/imsenterprise/db/upgrade.php | 3 - enrol/lti/db/upgrade.php | 3 - enrol/manual/db/upgrade.php | 3 - enrol/mnet/db/upgrade.php | 3 - enrol/paypal/db/upgrade.php | 84 --- enrol/self/db/upgrade.php | 3 - filter/mathjaxloader/db/upgrade.php | 3 - filter/mediaplugin/db/upgrade.php | 3 - filter/tex/db/upgrade.php | 3 - grade/grading/form/guide/db/upgrade.php | 3 - grade/grading/form/rubric/db/upgrade.php | 3 - grade/report/overview/db/upgrade.php | 3 - grade/report/user/db/upgrade.php | 3 - lib/antivirus/clamav/db/upgrade.php | 3 - lib/db/upgrade.php | 634 +----------------- lib/editor/atto/db/upgrade.php | 3 - .../atto/plugins/equation/db/upgrade.php | 3 - lib/editor/tinymce/db/upgrade.php | 3 - .../plugins/spellchecker/db/upgrade.php | 3 - message/output/email/db/upgrade.php | 3 - message/output/jabber/db/upgrade.php | 3 - message/output/popup/db/upgrade.php | 3 - mod/assign/db/upgrade.php | 3 - mod/assign/feedback/comments/db/upgrade.php | 3 - mod/assign/feedback/editpdf/db/upgrade.php | 36 - mod/assign/feedback/file/db/upgrade.php | 3 - mod/assign/submission/comments/db/upgrade.php | 3 - mod/assign/submission/file/db/upgrade.php | 3 - .../submission/onlinetext/db/upgrade.php | 3 - mod/assignment/db/upgrade.php | 3 - mod/book/db/upgrade.php | 3 - mod/chat/db/upgrade.php | 3 - mod/choice/db/upgrade.php | 3 - mod/data/db/upgrade.php | 3 - mod/feedback/db/upgrade.php | 3 - mod/folder/db/upgrade.php | 3 - mod/forum/db/upgrade.php | 3 - mod/glossary/db/upgrade.php | 69 -- mod/imscp/db/upgrade.php | 3 - mod/label/db/upgrade.php | 3 - mod/lesson/db/upgrade.php | 3 - mod/lti/db/upgrade.php | 3 - mod/page/db/upgrade.php | 3 - mod/quiz/db/upgrade.php | 3 - mod/quiz/report/overview/db/upgrade.php | 37 - mod/quiz/report/statistics/db/upgrade.php | 3 - mod/resource/db/upgrade.php | 3 - mod/scorm/db/upgrade.php | 3 - mod/survey/db/upgrade.php | 3 - mod/url/db/upgrade.php | 3 - mod/wiki/db/upgrade.php | 3 - mod/workshop/db/upgrade.php | 44 -- mod/workshop/form/accumulative/db/upgrade.php | 3 - mod/workshop/form/comments/db/upgrade.php | 3 - mod/workshop/form/numerrors/db/upgrade.php | 3 - mod/workshop/form/rubric/db/upgrade.php | 3 - portfolio/boxnet/db/upgrade.php | 3 - portfolio/googledocs/db/upgrade.php | 3 - portfolio/picasa/db/upgrade.php | 3 - .../behaviour/manualgraded/db/upgrade.php | 3 - question/type/calculated/db/upgrade.php | 3 - question/type/ddmarker/db/upgrade.php | 3 - question/type/essay/db/upgrade.php | 4 +- question/type/match/db/upgrade.php | 3 - question/type/multianswer/db/upgrade.php | 3 - question/type/multichoice/db/upgrade.php | 4 +- question/type/numerical/db/upgrade.php | 3 - question/type/random/db/upgrade.php | 3 - question/type/randomsamatch/db/upgrade.php | 3 - question/type/shortanswer/db/upgrade.php | 3 - repository/boxnet/db/upgrade.php | 3 - repository/dropbox/db/upgrade.php | 3 - repository/flickr/db/upgrade.php | 3 - repository/googledocs/db/upgrade.php | 3 - repository/onedrive/db/upgrade.php | 3 - repository/picasa/db/upgrade.php | 3 - 111 files changed, 6 insertions(+), 1513 deletions(-) diff --git a/admin/tool/customlang/db/upgrade.php b/admin/tool/customlang/db/upgrade.php index 8d00b39235a..c66946d94f0 100644 --- a/admin/tool/customlang/db/upgrade.php +++ b/admin/tool/customlang/db/upgrade.php @@ -29,9 +29,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_tool_customlang_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/admin/tool/dataprivacy/db/upgrade.php b/admin/tool/dataprivacy/db/upgrade.php index 64873753f92..4c1e3cc9639 100644 --- a/admin/tool/dataprivacy/db/upgrade.php +++ b/admin/tool/dataprivacy/db/upgrade.php @@ -35,284 +35,6 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) { $dbman = $DB->get_manager(); - if ($oldversion < 2018051405) { - // Define table tool_dataprivacy_ctxexpired to be created. - $table = new xmldb_table('tool_dataprivacy_ctxexpired'); - - // Adding fields to table tool_dataprivacy_ctxexpired. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('status', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table tool_dataprivacy_ctxexpired. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('contextid', XMLDB_KEY_FOREIGN_UNIQUE, array('contextid'), 'context', array('id')); - - // Conditionally launch create table for tool_dataprivacy_ctxexpired. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Define table tool_dataprivacy_contextlist to be created. - $table = new xmldb_table('tool_dataprivacy_contextlist'); - - // Adding fields to table tool_dataprivacy_contextlist. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('component', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0'); - - // Adding keys to table tool_dataprivacy_contextlist. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Conditionally launch create table for tool_dataprivacy_contextlist. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Define table tool_dataprivacy_ctxlst_ctx to be created. - $table = new xmldb_table('tool_dataprivacy_ctxlst_ctx'); - - // Adding fields to table tool_dataprivacy_ctxlst_ctx. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('contextlistid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('status', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0'); - - // Adding keys to table tool_dataprivacy_ctxlst_ctx. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('contextlistid', XMLDB_KEY_FOREIGN, array('contextlistid'), 'tool_dataprivacy_contextlist', array('id')); - - // Conditionally launch create table for tool_dataprivacy_ctxlst_ctx. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Define table tool_dataprivacy_rqst_ctxlst to be created. - $table = new xmldb_table('tool_dataprivacy_rqst_ctxlst'); - - // Adding fields to table tool_dataprivacy_rqst_ctxlst. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('requestid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('contextlistid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table tool_dataprivacy_rqst_ctxlst. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('requestid', XMLDB_KEY_FOREIGN, array('requestid'), 'tool_dataprivacy_request', array('id')); - $table->add_key('contextlistid', XMLDB_KEY_FOREIGN, array('contextlistid'), 'tool_dataprivacy_contextlist', array('id')); - $table->add_key('request_contextlist', XMLDB_KEY_UNIQUE, array('requestid', 'contextlistid')); - - // Conditionally launch create table for tool_dataprivacy_rqst_ctxlst. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Define field lawfulbases to be added to tool_dataprivacy_purpose. - $table = new xmldb_table('tool_dataprivacy_purpose'); - - // It is a required field. We initially define and add it as null and later update it to XMLDB_NOTNULL. - $field = new xmldb_field('lawfulbases', XMLDB_TYPE_TEXT, null, null, null, null, null, 'descriptionformat'); - - // Conditionally launch add field lawfulbases. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - - // Set a kind-of-random value to lawfulbasis field. - $DB->set_field('tool_dataprivacy_purpose', 'lawfulbases', 'gdpr_art_6_1_a'); - - // We redefine it now as not null. - $field = new xmldb_field('lawfulbases', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null, 'descriptionformat'); - - // Launch change of nullability for field lawfulbases. - $dbman->change_field_notnull($table, $field); - } - - // Define field sensitivedatareasons to be added to tool_dataprivacy_purpose. - $table = new xmldb_table('tool_dataprivacy_purpose'); - $field = new xmldb_field('sensitivedatareasons', XMLDB_TYPE_TEXT, null, null, null, null, null, 'lawfulbases'); - - // Conditionally launch add field sensitivedatareasons. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Dataprivacy savepoint reached. - upgrade_plugin_savepoint(true, 2018051405, 'tool', 'dataprivacy'); - } - - if ($oldversion < 2018051406) { - // Update completed delete requests to new delete status. - $query = "UPDATE {tool_dataprivacy_request} - SET status = :setstatus - WHERE type = :type - AND status = :wherestatus"; - $params = array( - 'setstatus' => 10, // Request deleted. - 'type' => 2, // Delete type. - 'wherestatus' => 5, // Request completed. - ); - - $DB->execute($query, $params); - - // Update completed data export requests to new download ready status. - $params = array( - 'setstatus' => 8, // Request download ready. - 'type' => 1, // export type. - 'wherestatus' => 5, // Request completed. - ); - - $DB->execute($query, $params); - - upgrade_plugin_savepoint(true, 2018051406, 'tool', 'dataprivacy'); - } - - if ($oldversion < 2018082100) { - - // Changing precision of field status on table tool_dataprivacy_request to (2). - $table = new xmldb_table('tool_dataprivacy_request'); - $field = new xmldb_field('status', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'requestedby'); - - // Launch change of precision for field status. - $dbman->change_field_precision($table, $field); - - // Dataprivacy savepoint reached. - upgrade_plugin_savepoint(true, 2018082100, 'tool', 'dataprivacy'); - } - - if ($oldversion < 2018100401) { - // Define table tool_dataprivacy_purposerole to be created. - $table = new xmldb_table('tool_dataprivacy_purposerole'); - - // Adding fields to table tool_dataprivacy_purposerole. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('purposeid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('roleid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('lawfulbases', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('sensitivedatareasons', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('retentionperiod', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('protected', XMLDB_TYPE_INTEGER, '1', null, null, null, null); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table tool_dataprivacy_purposerole. - $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); - $table->add_key('purposepurposeid', XMLDB_KEY_FOREIGN, ['purposeid'], 'tool_dataprivacy_purpose', ['id']); - $table->add_key('puproseroleid', XMLDB_KEY_FOREIGN, ['roleid'], 'role', ['id']); - - // Adding indexes to table tool_dataprivacy_purposerole. - $table->add_index('purposerole', XMLDB_INDEX_UNIQUE, ['purposeid', 'roleid']); - - // Conditionally launch create table for tool_dataprivacy_purposerole. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Update the ctxexpired table. - $table = new xmldb_table('tool_dataprivacy_ctxexpired'); - - // Add the unexpiredroles field. - $field = new xmldb_field('unexpiredroles', XMLDB_TYPE_TEXT, null, null, null, null, null, 'contextid'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - $DB->set_field('tool_dataprivacy_ctxexpired', 'unexpiredroles', ''); - - // Add the expiredroles field. - $field = new xmldb_field('expiredroles', XMLDB_TYPE_TEXT, null, null, null, null, null, 'unexpiredroles'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - $DB->set_field('tool_dataprivacy_ctxexpired', 'expiredroles', ''); - - // Add the defaultexpired field. - $field = new xmldb_field('defaultexpired', XMLDB_TYPE_INTEGER, '1', null, null, null, '1', 'expiredroles'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Change the default for the expired field to be empty. - $field = new xmldb_field('defaultexpired', XMLDB_TYPE_INTEGER, '1', null, null, null, null, 'expiredroles'); - $dbman->change_field_default($table, $field); - - // Prevent hte field from being nullable. - $field = new xmldb_field('defaultexpired', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null, 'expiredroles'); - $dbman->change_field_notnull($table, $field); - - // Dataprivacy savepoint reached. - upgrade_plugin_savepoint(true, 2018100401, 'tool', 'dataprivacy'); - } - - if ($oldversion < 2018100406) { - // Define field sensitivedatareasons to be added to tool_dataprivacy_purpose. - $table = new xmldb_table('tool_dataprivacy_request'); - $field = new xmldb_field('creationmethod', XMLDB_TYPE_INTEGER, 10, null, XMLDB_NOTNULL, null, 0, 'timemodified'); - - // Conditionally launch add field sensitivedatareasons. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Dataprivacy savepoint reached. - upgrade_plugin_savepoint(true, 2018100406, 'tool', 'dataprivacy'); - } - - - if ($oldversion < 2018110700) { - // Define table tool_dataprivacy_ctxlst_ctx to be dropped. - $table = new xmldb_table('tool_dataprivacy_ctxlst_ctx'); - - // Conditionally launch drop table for tool_dataprivacy_ctxlst_ctx. - if ($dbman->table_exists($table)) { - $dbman->drop_table($table); - } - - // Define table tool_dataprivacy_rqst_ctxlst to be dropped. - $table = new xmldb_table('tool_dataprivacy_rqst_ctxlst'); - - // Conditionally launch drop table for tool_dataprivacy_rqst_ctxlst. - if ($dbman->table_exists($table)) { - $dbman->drop_table($table); - } - - // Define table tool_dataprivacy_contextlist to be dropped. - $table = new xmldb_table('tool_dataprivacy_contextlist'); - - // Conditionally launch drop table for tool_dataprivacy_contextlist. - if ($dbman->table_exists($table)) { - $dbman->drop_table($table); - } - - // Update all requests which were in states Pending, or Pre-Processing, to Awaiting approval. - $DB->set_field('tool_dataprivacy_request', 'status', 2, ['status' => 0]); - $DB->set_field('tool_dataprivacy_request', 'status', 2, ['status' => 1]); - - // Remove the old initiate_data_request_task adhoc entries. - $DB->delete_records('task_adhoc', ['classname' => '\tool_dataprivacy\task\initiate_data_request_task']); - - // Dataprivacy savepoint reached. - upgrade_plugin_savepoint(true, 2018110700, 'tool', 'dataprivacy'); - } - - if ($oldversion < 2018112500) { - // Delete orphaned data privacy requests. - $sql = "SELECT r.id - FROM {tool_dataprivacy_request} r LEFT JOIN {user} u ON r.userid = u.id - WHERE u.id IS NULL"; - $orphaned = $DB->get_fieldset_sql($sql); - - if ($orphaned) { - $DB->delete_records_list('tool_dataprivacy_request', 'id', $orphaned); - } - - upgrade_plugin_savepoint(true, 2018112500, 'tool', 'dataprivacy'); - } - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/admin/tool/log/db/upgrade.php b/admin/tool/log/db/upgrade.php index e8469dc75c8..75315ed59f0 100644 --- a/admin/tool/log/db/upgrade.php +++ b/admin/tool/log/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_tool_log_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/admin/tool/log/store/database/db/upgrade.php b/admin/tool/log/store/database/db/upgrade.php index 525352f1f90..ee94bc9eefa 100644 --- a/admin/tool/log/store/database/db/upgrade.php +++ b/admin/tool/log/store/database/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_logstore_database_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/admin/tool/log/store/standard/db/upgrade.php b/admin/tool/log/store/standard/db/upgrade.php index db7076ca4c0..82a3f796964 100644 --- a/admin/tool/log/store/standard/db/upgrade.php +++ b/admin/tool/log/store/standard/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_logstore_standard_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/admin/tool/monitor/db/upgrade.php b/admin/tool/monitor/db/upgrade.php index a71bb4d631a..c4564f5b4d9 100644 --- a/admin/tool/monitor/db/upgrade.php +++ b/admin/tool/monitor/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_tool_monitor_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/admin/tool/policy/db/upgrade.php b/admin/tool/policy/db/upgrade.php index a6cb52770cf..0ef408f71c6 100644 --- a/admin/tool/policy/db/upgrade.php +++ b/admin/tool/policy/db/upgrade.php @@ -34,32 +34,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_tool_policy_upgrade($oldversion) { global $DB; - $dbman = $DB->get_manager(); - - if ($oldversion < 2018082900) { - // Add field agreementstyle to the table tool_policy_versions. - $table = new xmldb_table('tool_policy_versions'); - $field = new xmldb_field('agreementstyle', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL, null, '0', 'policyid'); - - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - upgrade_plugin_savepoint(true, 2018082900, 'tool', 'policy'); - } - - if ($oldversion < 2018091800) { - // Add field "optional" to the table "tool_policy_versions". - $table = new xmldb_table('tool_policy_versions'); - $field = new xmldb_field('optional', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL, null, '0', 'agreementstyle'); - - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - upgrade_plugin_savepoint(true, 2018091800, 'tool', 'policy'); - } - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/admin/tool/usertours/db/upgrade.php b/admin/tool/usertours/db/upgrade.php index f7ef9fc3086..49b95339d20 100644 --- a/admin/tool/usertours/db/upgrade.php +++ b/admin/tool/usertours/db/upgrade.php @@ -36,9 +36,6 @@ use tool_usertours\tour; function xmldb_tool_usertours_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/auth/cas/db/upgrade.php b/auth/cas/db/upgrade.php index b4e380b02d6..fe355254d64 100644 --- a/auth/cas/db/upgrade.php +++ b/auth/cas/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_auth_cas_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/auth/db/db/upgrade.php b/auth/db/db/upgrade.php index 33fc2254a79..36caabd4ea8 100644 --- a/auth/db/db/upgrade.php +++ b/auth/db/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_auth_db_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/auth/email/db/upgrade.php b/auth/email/db/upgrade.php index 47e43b25fe2..87eead47355 100644 --- a/auth/email/db/upgrade.php +++ b/auth/email/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_auth_email_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/auth/ldap/db/upgrade.php b/auth/ldap/db/upgrade.php index 962ff832a8a..601b0ac43c1 100644 --- a/auth/ldap/db/upgrade.php +++ b/auth/ldap/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_auth_ldap_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/auth/manual/db/upgrade.php b/auth/manual/db/upgrade.php index f90db80d22f..800d9d1f76e 100644 --- a/auth/manual/db/upgrade.php +++ b/auth/manual/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_auth_manual_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/auth/mnet/db/upgrade.php b/auth/mnet/db/upgrade.php index b97a10d4a1a..a08b10f7332 100644 --- a/auth/mnet/db/upgrade.php +++ b/auth/mnet/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_auth_mnet_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/auth/none/db/upgrade.php b/auth/none/db/upgrade.php index 41fc21e4f5f..1d4c1bd7be7 100644 --- a/auth/none/db/upgrade.php +++ b/auth/none/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_auth_none_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/auth/oauth2/db/upgrade.php b/auth/oauth2/db/upgrade.php index f977861108c..547cc107959 100644 --- a/auth/oauth2/db/upgrade.php +++ b/auth/oauth2/db/upgrade.php @@ -35,9 +35,6 @@ function xmldb_auth_oauth2_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/auth/shibboleth/db/upgrade.php b/auth/shibboleth/db/upgrade.php index 191dd3f477a..d8fd24824bc 100644 --- a/auth/shibboleth/db/upgrade.php +++ b/auth/shibboleth/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_auth_shibboleth_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/badges/db/upgrade.php b/blocks/badges/db/upgrade.php index ecf0643998f..07cc019afaf 100644 --- a/blocks/badges/db/upgrade.php +++ b/blocks/badges/db/upgrade.php @@ -45,9 +45,6 @@ function xmldb_block_badges_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/calendar_month/db/upgrade.php b/blocks/calendar_month/db/upgrade.php index 62a329375b9..82b01c43d64 100644 --- a/blocks/calendar_month/db/upgrade.php +++ b/blocks/calendar_month/db/upgrade.php @@ -45,9 +45,6 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/calendar_upcoming/db/upgrade.php b/blocks/calendar_upcoming/db/upgrade.php index e3759d00f84..71e5a012153 100644 --- a/blocks/calendar_upcoming/db/upgrade.php +++ b/blocks/calendar_upcoming/db/upgrade.php @@ -45,9 +45,6 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/completionstatus/db/upgrade.php b/blocks/completionstatus/db/upgrade.php index 8e1c300fefe..8cf5e4a05c0 100644 --- a/blocks/completionstatus/db/upgrade.php +++ b/blocks/completionstatus/db/upgrade.php @@ -48,9 +48,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_block_completionstatus_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/course_summary/db/upgrade.php b/blocks/course_summary/db/upgrade.php index f4993299ca6..076e6b8ecb0 100644 --- a/blocks/course_summary/db/upgrade.php +++ b/blocks/course_summary/db/upgrade.php @@ -48,9 +48,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_block_course_summary_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/html/db/upgrade.php b/blocks/html/db/upgrade.php index c74adb5e890..4507ebeb946 100644 --- a/blocks/html/db/upgrade.php +++ b/blocks/html/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_block_html_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/navigation/db/upgrade.php b/blocks/navigation/db/upgrade.php index a7be67fb843..8bd15866945 100644 --- a/blocks/navigation/db/upgrade.php +++ b/blocks/navigation/db/upgrade.php @@ -55,9 +55,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_block_navigation_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/quiz_results/db/upgrade.php b/blocks/quiz_results/db/upgrade.php index 5d323e6fd6c..ad921eb1121 100644 --- a/blocks/quiz_results/db/upgrade.php +++ b/blocks/quiz_results/db/upgrade.php @@ -45,9 +45,6 @@ function xmldb_block_quiz_results_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/recent_activity/db/upgrade.php b/blocks/recent_activity/db/upgrade.php index 4b560f1db9f..753703a6c45 100644 --- a/blocks/recent_activity/db/upgrade.php +++ b/blocks/recent_activity/db/upgrade.php @@ -47,9 +47,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_block_recent_activity_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/rss_client/db/upgrade.php b/blocks/rss_client/db/upgrade.php index 78074f05d79..6c47d8bf1e1 100644 --- a/blocks/rss_client/db/upgrade.php +++ b/blocks/rss_client/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_block_rss_client_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/section_links/db/upgrade.php b/blocks/section_links/db/upgrade.php index 3c30d67d005..18f7d3beab1 100644 --- a/blocks/section_links/db/upgrade.php +++ b/blocks/section_links/db/upgrade.php @@ -49,9 +49,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_block_section_links_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/selfcompletion/db/upgrade.php b/blocks/selfcompletion/db/upgrade.php index 677886a6421..58aebb3f758 100644 --- a/blocks/selfcompletion/db/upgrade.php +++ b/blocks/selfcompletion/db/upgrade.php @@ -48,9 +48,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_block_selfcompletion_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/settings/db/upgrade.php b/blocks/settings/db/upgrade.php index 1b5e6d73b8c..7687fd0d7cb 100644 --- a/blocks/settings/db/upgrade.php +++ b/blocks/settings/db/upgrade.php @@ -55,9 +55,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_block_settings_upgrade($oldversion, $block) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/course/format/topics/db/upgrade.php b/course/format/topics/db/upgrade.php index 16e8014f9a7..1943689eb6b 100644 --- a/course/format/topics/db/upgrade.php +++ b/course/format/topics/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_format_topics_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/course/format/weeks/db/upgrade.php b/course/format/weeks/db/upgrade.php index 3da8eff8b97..234971b3a74 100644 --- a/course/format/weeks/db/upgrade.php +++ b/course/format/weeks/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_format_weeks_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/enrol/database/db/upgrade.php b/enrol/database/db/upgrade.php index bf71daa2051..3b0194ce1fe 100644 --- a/enrol/database/db/upgrade.php +++ b/enrol/database/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_enrol_database_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/enrol/flatfile/db/upgrade.php b/enrol/flatfile/db/upgrade.php index 0279741bdfd..b1ed8d966e7 100644 --- a/enrol/flatfile/db/upgrade.php +++ b/enrol/flatfile/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_enrol_flatfile_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/enrol/guest/db/upgrade.php b/enrol/guest/db/upgrade.php index d9a9691553d..c642f7a9260 100644 --- a/enrol/guest/db/upgrade.php +++ b/enrol/guest/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_enrol_guest_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/enrol/imsenterprise/db/upgrade.php b/enrol/imsenterprise/db/upgrade.php index 601f629f9be..44f73ea6526 100644 --- a/enrol/imsenterprise/db/upgrade.php +++ b/enrol/imsenterprise/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_enrol_imsenterprise_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/enrol/lti/db/upgrade.php b/enrol/lti/db/upgrade.php index d2bca9fd719..0237e105e48 100644 --- a/enrol/lti/db/upgrade.php +++ b/enrol/lti/db/upgrade.php @@ -39,9 +39,6 @@ function xmldb_enrol_lti_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/enrol/manual/db/upgrade.php b/enrol/manual/db/upgrade.php index dd475cab653..02932d28e17 100644 --- a/enrol/manual/db/upgrade.php +++ b/enrol/manual/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_enrol_manual_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/enrol/mnet/db/upgrade.php b/enrol/mnet/db/upgrade.php index 04983f0706b..1c4f1862a23 100644 --- a/enrol/mnet/db/upgrade.php +++ b/enrol/mnet/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_enrol_mnet_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/enrol/paypal/db/upgrade.php b/enrol/paypal/db/upgrade.php index 2becc9b3ff6..71dff916eb9 100644 --- a/enrol/paypal/db/upgrade.php +++ b/enrol/paypal/db/upgrade.php @@ -45,90 +45,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_enrol_paypal_upgrade($oldversion) { global $DB; - $dbman = $DB->get_manager(); - - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2018053000) { - - // Define field instanceid to be added to enrol_paypal. - // For some reason, some Moodle instances that are upgraded from old versions do not have this field. - $table = new xmldb_table('enrol_paypal'); - $field = new xmldb_field('instanceid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'userid'); - - // Conditionally launch add field instanceid. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Paypal savepoint reached. - upgrade_plugin_savepoint(true, 2018053000, 'enrol', 'paypal'); - } - - if ($oldversion < 2018062500) { - - // Define key courseid (foreign) to be added to enrol_paypal. - $table = new xmldb_table('enrol_paypal'); - $key = new xmldb_key('courseid', XMLDB_KEY_FOREIGN, array('courseid'), 'course', array('id')); - - // Launch add key courseid. - $dbman->add_key($table, $key); - - // Paypal savepoint reached. - upgrade_plugin_savepoint(true, 2018062500, 'enrol', 'paypal'); - } - - if ($oldversion < 2018062501) { - - // Define key userid (foreign) to be added to enrol_paypal. - $table = new xmldb_table('enrol_paypal'); - $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id')); - - // Launch add key userid. - $dbman->add_key($table, $key); - - // Paypal savepoint reached. - upgrade_plugin_savepoint(true, 2018062501, 'enrol', 'paypal'); - } - - if ($oldversion < 2018062502) { - - // Define key instanceid (foreign) to be added to enrol_paypal. - $table = new xmldb_table('enrol_paypal'); - $key = new xmldb_key('instanceid', XMLDB_KEY_FOREIGN, array('instanceid'), 'enrol', array('id')); - - // Launch add key instanceid. - $dbman->add_key($table, $key); - - // Paypal savepoint reached. - upgrade_plugin_savepoint(true, 2018062502, 'enrol', 'paypal'); - } - - if ($oldversion < 2018062503) { - - $table = new xmldb_table('enrol_paypal'); - - // Define index business (not unique) to be added to enrol_paypal. - $index = new xmldb_index('business', XMLDB_INDEX_NOTUNIQUE, array('business')); - - // Conditionally launch add index business. - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - // Define index receiver_email (not unique) to be added to enrol_paypal. - $index = new xmldb_index('receiver_email', XMLDB_INDEX_NOTUNIQUE, array('receiver_email')); - - // Conditionally launch add index receiver_email. - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - // Paypal savepoint reached. - upgrade_plugin_savepoint(true, 2018062503, 'enrol', 'paypal'); - } - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/enrol/self/db/upgrade.php b/enrol/self/db/upgrade.php index b6e75de4847..99f906d2a63 100644 --- a/enrol/self/db/upgrade.php +++ b/enrol/self/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_enrol_self_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/filter/mathjaxloader/db/upgrade.php b/filter/mathjaxloader/db/upgrade.php index 0dfe15f946b..9212c8b2a59 100644 --- a/filter/mathjaxloader/db/upgrade.php +++ b/filter/mathjaxloader/db/upgrade.php @@ -31,9 +31,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_filter_mathjaxloader_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/filter/mediaplugin/db/upgrade.php b/filter/mediaplugin/db/upgrade.php index 1a90578a978..a67350048be 100644 --- a/filter/mediaplugin/db/upgrade.php +++ b/filter/mediaplugin/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_filter_mediaplugin_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/filter/tex/db/upgrade.php b/filter/tex/db/upgrade.php index b3cf967f7de..88b2c4ce62d 100644 --- a/filter/tex/db/upgrade.php +++ b/filter/tex/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_filter_tex_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/grade/grading/form/guide/db/upgrade.php b/grade/grading/form/guide/db/upgrade.php index 0172cf3824c..b2936ea889e 100644 --- a/grade/grading/form/guide/db/upgrade.php +++ b/grade/grading/form/guide/db/upgrade.php @@ -37,9 +37,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_gradingform_guide_upgrade($oldversion) { global $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/grade/grading/form/rubric/db/upgrade.php b/grade/grading/form/rubric/db/upgrade.php index 9d5de48d511..9c19dd7a128 100644 --- a/grade/grading/form/rubric/db/upgrade.php +++ b/grade/grading/form/rubric/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_gradingform_rubric_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/grade/report/overview/db/upgrade.php b/grade/report/overview/db/upgrade.php index 3ead78d0f4f..dc24c16d6e9 100644 --- a/grade/report/overview/db/upgrade.php +++ b/grade/report/overview/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); */ function xmldb_gradereport_overview_upgrade($oldversion) { - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/grade/report/user/db/upgrade.php b/grade/report/user/db/upgrade.php index 7dabcc618fc..752cbae365f 100644 --- a/grade/report/user/db/upgrade.php +++ b/grade/report/user/db/upgrade.php @@ -29,9 +29,6 @@ function xmldb_gradereport_user_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/lib/antivirus/clamav/db/upgrade.php b/lib/antivirus/clamav/db/upgrade.php index fc4b43582ae..84179d35edd 100644 --- a/lib/antivirus/clamav/db/upgrade.php +++ b/lib/antivirus/clamav/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); */ function xmldb_antivirus_clamav_upgrade($oldversion) { - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 34a63575323..10ac8a8026a 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -92,639 +92,13 @@ function xmldb_main_upgrade($oldversion) { $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. // Always keep this upgrade step with version being the minimum - // allowed version to upgrade from (v3.5.0 right now). - if ($oldversion < 2018051700) { + // allowed version to upgrade from (v3.6.0 right now). + if ($oldversion < 2018120300) { // Just in case somebody hacks upgrade scripts or env, we really can not continue. - echo("You need to upgrade to 3.5.x or higher first!\n"); + echo("You need to upgrade to 3.6.x or higher first!\n"); exit(1); // Note this savepoint is 100% unreachable, but needed to pass the upgrade checks. - upgrade_main_savepoint(true, 2018051700); - } - - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2018062800.01) { - // Add foreign key fk_user to the comments table. - $table = new xmldb_table('comments'); - $key = new xmldb_key('fk_user', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id')); - $dbman->add_key($table, $key); - - upgrade_main_savepoint(true, 2018062800.01); - } - - if ($oldversion < 2018062800.02) { - // Add composite index ix_concomitem to the table comments. - $table = new xmldb_table('comments'); - $index = new xmldb_index('ix_concomitem', XMLDB_INDEX_NOTUNIQUE, array('contextid', 'commentarea', 'itemid')); - - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - upgrade_main_savepoint(true, 2018062800.02); - } - - if ($oldversion < 2018062800.03) { - // Define field location to be added to event. - $table = new xmldb_table('event'); - $field = new xmldb_field('location', XMLDB_TYPE_TEXT, null, null, null, null, null, 'priority'); - - // Conditionally launch add field location. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018062800.03); - } - - if ($oldversion < 2018072500.00) { - // Find all duplicate top level categories per context. - $duplicates = $DB->get_records_sql("SELECT qc1.* - FROM {question_categories} qc1 - JOIN {question_categories} qc2 - ON qc1.contextid = qc2.contextid AND qc1.id <> qc2.id - WHERE qc1.parent = 0 AND qc2.parent = 0 - ORDER BY qc1.contextid, qc1.id"); - - // For each context, let the first top category to remain as top category and make the rest its children. - $currentcontextid = 0; - $chosentopid = 0; - foreach ($duplicates as $duplicate) { - if ($currentcontextid != $duplicate->contextid) { - $currentcontextid = $duplicate->contextid; - $chosentopid = $duplicate->id; - } else { - $DB->set_field('question_categories', 'parent', $chosentopid, ['id' => $duplicate->id]); - } - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018072500.00); - } - - if ($oldversion < 2018073000.00) { - // Main savepoint reached. - if (!file_exists($CFG->dirroot . '/admin/tool/assignmentupgrade/version.php')) { - unset_all_config_for_plugin('tool_assignmentupgrade'); - } - upgrade_main_savepoint(true, 2018073000.00); - } - - if ($oldversion < 2018083100.01) { - // Remove module associated blog posts for non-existent (deleted) modules. - $sql = "SELECT ba.contextid as modcontextid - FROM {blog_association} ba - JOIN {post} p - ON p.id = ba.blogid - LEFT JOIN {context} c - ON c.id = ba.contextid - WHERE p.module = :module - AND c.contextlevel IS NULL - GROUP BY ba.contextid"; - if ($deletedmodules = $DB->get_records_sql($sql, array('module' => 'blog'))) { - foreach ($deletedmodules as $module) { - $assocblogids = $DB->get_fieldset_select('blog_association', 'blogid', - 'contextid = :contextid', ['contextid' => $module->modcontextid]); - list($sql, $params) = $DB->get_in_or_equal($assocblogids, SQL_PARAMS_NAMED); - - $DB->delete_records_select('tag_instance', "itemid $sql", $params); - $DB->delete_records_select('post', "id $sql AND module = :module", - array_merge($params, ['module' => 'blog'])); - $DB->delete_records('blog_association', ['contextid' => $module->modcontextid]); - } - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018083100.01); - } - - if ($oldversion < 2018091200.00) { - if (!file_exists($CFG->dirroot . '/cache/stores/memcache/settings.php')) { - unset_all_config_for_plugin('cachestore_memcache'); - } - - upgrade_main_savepoint(true, 2018091200.00); - } - - if ($oldversion < 2018091700.01) { - // Remove unused setting. - unset_config('messaginghidereadnotifications'); - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018091700.01); - } - - // Add idnumber fields to question and question_category tables. - // This is done in four parts to aid error recovery during upgrade, should that occur. - if ($oldversion < 2018092100.01) { - $table = new xmldb_table('question'); - $field = new xmldb_field('idnumber', XMLDB_TYPE_CHAR, '100', null, null, null, null, 'modifiedby'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - upgrade_main_savepoint(true, 2018092100.01); - } - - if ($oldversion < 2018092100.02) { - $table = new xmldb_table('question'); - $index = new xmldb_index('categoryidnumber', XMLDB_INDEX_UNIQUE, array('category', 'idnumber')); - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - upgrade_main_savepoint(true, 2018092100.02); - } - - if ($oldversion < 2018092100.03) { - $table = new xmldb_table('question_categories'); - $field = new xmldb_field('idnumber', XMLDB_TYPE_CHAR, '100', null, null, null, null, 'sortorder'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - upgrade_main_savepoint(true, 2018092100.03); - } - - if ($oldversion < 2018092100.04) { - $table = new xmldb_table('question_categories'); - $index = new xmldb_index('contextididnumber', XMLDB_INDEX_UNIQUE, array('contextid', 'idnumber')); - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - // Main savepoint reached. - upgrade_main_savepoint(true, 2018092100.04); - } - - if ($oldversion < 2018092800.00) { - // Alter the table 'message_contacts'. - $table = new xmldb_table('message_contacts'); - - // Remove index so we can alter the fields. - $index = new xmldb_index('userid-contactid', XMLDB_INDEX_UNIQUE, ['userid', 'contactid']); - if ($dbman->index_exists($table, $index)) { - $dbman->drop_index($table, $index); - } - - // Remove defaults of '0' from the 'userid' and 'contactid' fields. - $field = new xmldb_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'id'); - $dbman->change_field_default($table, $field); - - $field = new xmldb_field('contactid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'userid'); - $dbman->change_field_default($table, $field); - - // Add the missing FKs that will now be added to new installs. - $key = new xmldb_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); - $dbman->add_key($table, $key); - - $key = new xmldb_key('contactid', XMLDB_KEY_FOREIGN, ['contactid'], 'user', ['id']); - $dbman->add_key($table, $key); - - // Re-add the index. - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - // Add the field 'timecreated'. Allow null, since existing records won't have an accurate value we can use. - $field = new xmldb_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'blocked'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Create new 'message_contact_requests' table. - $table = new xmldb_table('message_contact_requests'); - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null); - $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'id'); - $table->add_field('requesteduserid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'userid'); - $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'requesteduserid'); - - $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id'], null, null); - $table->add_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); - $table->add_key('requesteduserid', XMLDB_KEY_FOREIGN, ['requesteduserid'], 'user', ['id']); - - $table->add_index('userid-requesteduserid', XMLDB_INDEX_UNIQUE, ['userid', 'requesteduserid']); - - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Create new 'message_users_blocked' table. - $table = new xmldb_table('message_users_blocked'); - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null); - $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'id'); - $table->add_field('blockeduserid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'userid'); - // Allow NULLs in the 'timecreated' field because we will be moving existing data here that has no timestamp. - $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'blockeduserid'); - - $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id'], null, null); - $table->add_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); - $table->add_key('blockeduserid', XMLDB_KEY_FOREIGN, ['blockeduserid'], 'user', ['id']); - - $table->add_index('userid-blockeduserid', XMLDB_INDEX_UNIQUE, ['userid', 'blockeduserid']); - - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - upgrade_main_savepoint(true, 2018092800.00); - } - - if ($oldversion < 2018092800.01) { - // Move all the 'blocked' contacts to the new table 'message_users_blocked'. - $updatesql = "INSERT INTO {message_users_blocked} (userid, blockeduserid, timecreated) - SELECT userid, contactid, null as timecreated - FROM {message_contacts} - WHERE blocked = :blocked"; - $DB->execute($updatesql, ['blocked' => 1]); - - // Removed the 'blocked' column from 'message_contacts'. - $table = new xmldb_table('message_contacts'); - $field = new xmldb_field('blocked'); - $dbman->drop_field($table, $field); - - upgrade_main_savepoint(true, 2018092800.01); - } - - if ($oldversion < 2018092800.02) { - // Delete any contacts that are not mutual (meaning they both haven't added each other). - do { - $sql = "SELECT c1.id - FROM {message_contacts} c1 - LEFT JOIN {message_contacts} c2 - ON c1.userid = c2.contactid - AND c1.contactid = c2.userid - WHERE c2.id IS NULL"; - if ($contacts = $DB->get_records_sql($sql, null, 0, 1000)) { - list($insql, $inparams) = $DB->get_in_or_equal(array_keys($contacts)); - $DB->delete_records_select('message_contacts', "id $insql", $inparams); - } - } while ($contacts); - - upgrade_main_savepoint(true, 2018092800.02); - } - - if ($oldversion < 2018092800.03) { - // Remove any duplicate rows - from now on adding contacts just requires 1 row. - // The person who made the contact request (userid) and the person who approved - // it (contactid). Upgrade the table so that the first person to add the contact - // was the one who made the request. - $sql = "SELECT c1.id - FROM {message_contacts} c1 - INNER JOIN {message_contacts} c2 - ON c1.userid = c2.contactid - AND c1.contactid = c2.userid - WHERE c1.id > c2.id"; - if ($contacts = $DB->get_records_sql($sql)) { - list($insql, $inparams) = $DB->get_in_or_equal(array_keys($contacts)); - $DB->delete_records_select('message_contacts', "id $insql", $inparams); - } - - upgrade_main_savepoint(true, 2018092800.03); - } - - if ($oldversion < 2018101700.01) { - if (empty($CFG->keepmessagingallusersenabled)) { - // When it is not set, $CFG->messagingallusers should be disabled by default. - // When $CFG->messagingallusers = false, the default user preference is MESSAGE_PRIVACY_COURSEMEMBER - // (contacted by users sharing a course). - set_config('messagingallusers', false); - } else { - // When $CFG->keepmessagingallusersenabled is set to true, $CFG->messagingallusers is set to true. - set_config('messagingallusers', true); - - // When $CFG->messagingallusers = true, the default user preference is MESSAGE_PRIVACY_SITE - // (contacted by all users site). So we need to set existing values from 0 (MESSAGE_PRIVACY_COURSEMEMBER) - // to 2 (MESSAGE_PRIVACY_SITE). - $DB->set_field( - 'user_preferences', - 'value', - \core_message\api::MESSAGE_PRIVACY_SITE, - array('name' => 'message_blocknoncontacts', 'value' => 0) - ); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018101700.01); - } - - if ($oldversion < 2018101800.00) { - // Define table 'favourite' to be created. - $table = new xmldb_table('favourite'); - - // Adding fields to table favourite. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('component', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null); - $table->add_field('itemtype', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null); - $table->add_field('itemid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('ordering', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table favourite. - $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); - $table->add_key('contextid', XMLDB_KEY_FOREIGN, ['contextid'], 'context', ['id']); - $table->add_key('userid', XMLDB_KEY_FOREIGN, ['userid'], 'user', ['id']); - - // Adding indexes to table favourite. - $table->add_index('uniqueuserfavouriteitem', XMLDB_INDEX_UNIQUE, ['component', 'itemtype', 'itemid', 'contextid', 'userid']); - - // Conditionally launch create table for favourite. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018101800.00); - } - - if ($oldversion < 2018102200.00) { - // Add field 'type' to 'message_conversations'. - $table = new xmldb_table('message_conversations'); - $field = new xmldb_field('type', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, 1, 'id'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Add field 'name' to 'message_conversations'. - $field = new xmldb_field('name', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'type'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Conditionally launch add index 'type'. - $index = new xmldb_index('type', XMLDB_INDEX_NOTUNIQUE, ['type']); - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - // Define table 'message_conversations' to be updated. - $table = new xmldb_table('message_conversations'); - - // Remove the unique 'convhash' index, change to null and add a new non unique index. - $index = new xmldb_index('convhash', XMLDB_INDEX_UNIQUE, ['convhash']); - if ($dbman->index_exists($table, $index)) { - $dbman->drop_index($table, $index); - } - - $field = new xmldb_field('convhash', XMLDB_TYPE_CHAR, '40', null, null, null, null, 'name'); - $dbman->change_field_notnull($table, $field); - - $index = new xmldb_index('convhash', XMLDB_INDEX_NOTUNIQUE, ['convhash']); - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - upgrade_main_savepoint(true, 2018102200.00); - } - - if ($oldversion < 2018102300.02) { - // Alter 'message_conversations' table to support groups. - $table = new xmldb_table('message_conversations'); - $field = new xmldb_field('component', XMLDB_TYPE_CHAR, '100', null, null, null, null, 'convhash'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - $field = new xmldb_field('itemtype', XMLDB_TYPE_CHAR, '100', null, null, null, null, 'component'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - $field = new xmldb_field('itemid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'itemtype'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - $field = new xmldb_field('contextid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'itemid'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - $field = new xmldb_field('enabled', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, 0, 'contextid'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - $field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'enabled'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Add key. - $key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, ['contextid'], 'context', ['id']); - $dbman->add_key($table, $key); - - // Add index. - $index = new xmldb_index('component-itemtype-itemid-contextid', XMLDB_INDEX_NOTUNIQUE, ['component', 'itemtype', - 'itemid', 'contextid']); - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - upgrade_main_savepoint(true, 2018102300.02); - } - - if ($oldversion < 2018102900.00) { - // Define field predictionsprocessor to be added to analytics_models. - $table = new xmldb_table('analytics_models'); - $field = new xmldb_field('predictionsprocessor', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'timesplitting'); - - // Conditionally launch add field predictionsprocessor. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018102900.00); - } - - if ($oldversion < 2018110500.01) { - // Define fields to be added to the 'badge' table. - $tablebadge = new xmldb_table('badge'); - $fieldversion = new xmldb_field('version', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'nextcron'); - $fieldlanguage = new xmldb_field('language', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'version'); - $fieldimageauthorname = new xmldb_field('imageauthorname', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'language'); - $fieldimageauthoremail = new xmldb_field('imageauthoremail', XMLDB_TYPE_CHAR, '255', null, null, - null, null, 'imageauthorname'); - $fieldimageauthorurl = new xmldb_field('imageauthorurl', XMLDB_TYPE_CHAR, '255', null, null, - null, null, 'imageauthoremail'); - $fieldimagecaption = new xmldb_field('imagecaption', XMLDB_TYPE_TEXT, null, null, null, null, null, 'imageauthorurl'); - - if (!$dbman->field_exists($tablebadge, $fieldversion)) { - $dbman->add_field($tablebadge, $fieldversion); - } - if (!$dbman->field_exists($tablebadge, $fieldlanguage)) { - $dbman->add_field($tablebadge, $fieldlanguage); - } - if (!$dbman->field_exists($tablebadge, $fieldimageauthorname)) { - $dbman->add_field($tablebadge, $fieldimageauthorname); - } - if (!$dbman->field_exists($tablebadge, $fieldimageauthoremail)) { - $dbman->add_field($tablebadge, $fieldimageauthoremail); - } - if (!$dbman->field_exists($tablebadge, $fieldimageauthorurl)) { - $dbman->add_field($tablebadge, $fieldimageauthorurl); - } - if (!$dbman->field_exists($tablebadge, $fieldimagecaption)) { - $dbman->add_field($tablebadge, $fieldimagecaption); - } - - // Define table badge_endorsement to be created. - $table = new xmldb_table('badge_endorsement'); - - // Adding fields to table badge_endorsement. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('badgeid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('issuername', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('issuerurl', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('issueremail', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('claimid', XMLDB_TYPE_CHAR, '255', null, null, null, null); - $table->add_field('claimcomment', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('dateissued', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0'); - - // Adding keys to table badge_endorsement. - $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); - $table->add_key('endorsementbadge', XMLDB_KEY_FOREIGN, ['badgeid'], 'badge', ['id']); - - // Conditionally launch create table for badge_endorsement. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Define table badge_related to be created. - $table = new xmldb_table('badge_related'); - - // Adding fields to table badge_related. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('badgeid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('relatedbadgeid', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - - // Adding keys to table badge_related. - $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); - $table->add_key('badgeid', XMLDB_KEY_FOREIGN, ['badgeid'], 'badge', ['id']); - $table->add_key('relatedbadgeid', XMLDB_KEY_FOREIGN, ['relatedbadgeid'], 'badge', ['id']); - $table->add_key('badgeid-relatedbadgeid', XMLDB_KEY_UNIQUE, ['badgeid', 'relatedbadgeid']); - - // Conditionally launch create table for badge_related. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Define table badge_competencies to be created. - $table = new xmldb_table('badge_competencies'); - - // Adding fields to table badge_competencies. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('badgeid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('targetname', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('targeturl', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('targetdescription', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('targetframework', XMLDB_TYPE_CHAR, '255', null, null, null, null); - $table->add_field('targetcode', XMLDB_TYPE_CHAR, '255', null, null, null, null); - - // Adding keys to table badge_competencies. - $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); - $table->add_key('competenciesbadge', XMLDB_KEY_FOREIGN, ['badgeid'], 'badge', ['id']); - - // Conditionally launch create table for badge_competencies. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018110500.01); - } - - if ($oldversion < 2018110700.01) { - // This config setting added and then removed. - unset_config('showcourseimages', 'moodlecourse'); - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018110700.01); - } - - if ($oldversion < 2018111301.00) { - // Define field locked to be added to context. - $table = new xmldb_table('context'); - $field = new xmldb_field('locked', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'depth'); - - // Conditionally launch add field locked. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Define field locked to be added to context_temp. - $table = new xmldb_table('context_temp'); - $field = new xmldb_field('locked', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'depth'); - - // Conditionally launch add field locked. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Note: This change also requires a bump in is_major_upgrade_required. - upgrade_main_savepoint(true, 2018111301.00); - } - - if ($oldversion < 2018111900.00) { - // Update favourited courses, so they are saved in the particular course context instead of the system. - $favouritedcourses = $DB->get_records('favourite', ['component' => 'core_course', 'itemtype' => 'courses']); - - foreach ($favouritedcourses as $fc) { - $coursecontext = \context_course::instance($fc->itemid); - $fc->contextid = $coursecontext->id; - $DB->update_record('favourite', $fc); - } - - upgrade_main_savepoint(true, 2018111900.00); - } - - if ($oldversion < 2018111900.01) { - // Define table oauth2_access_token to be created. - $table = new xmldb_table('oauth2_access_token'); - - // Adding fields to table oauth2_access_token. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('issuerid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('token', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null); - $table->add_field('expires', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('scope', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null); - - // Adding keys to table oauth2_access_token. - $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']); - $table->add_key('issueridkey', XMLDB_KEY_FOREIGN_UNIQUE, ['issuerid'], 'oauth2_issuer', ['id']); - - // Conditionally launch create table for oauth2_access_token. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2018111900.01); - } - - if ($oldversion < 2018112000.00) { - // Update favourited conversations, so they are saved in the proper context instead of the system. - $sql = "SELECT f.*, mc.contextid as conversationctx - FROM {favourite} f - JOIN {message_conversations} mc - ON mc.id = f.itemid"; - $favouritedconversations = $DB->get_records_sql($sql); - foreach ($favouritedconversations as $fc) { - if (empty($fc->conversationctx)) { - $conversationidctx = \context_user::instance($fc->userid)->id; - } else { - $conversationidctx = $fc->conversationctx; - } - - $DB->set_field('favourite', 'contextid', $conversationidctx, ['id' => $fc->id]); - } - - upgrade_main_savepoint(true, 2018112000.00); + upgrade_main_savepoint(true, 2018120300); } // Automatically generated Moodle v3.6.0 release upgrade line. diff --git a/lib/editor/atto/db/upgrade.php b/lib/editor/atto/db/upgrade.php index ae6378e7851..411fb12812b 100644 --- a/lib/editor/atto/db/upgrade.php +++ b/lib/editor/atto/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_editor_atto_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/lib/editor/atto/plugins/equation/db/upgrade.php b/lib/editor/atto/plugins/equation/db/upgrade.php index 04e9bab8d42..bed48393bf1 100644 --- a/lib/editor/atto/plugins/equation/db/upgrade.php +++ b/lib/editor/atto/plugins/equation/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_atto_equation_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/lib/editor/tinymce/db/upgrade.php b/lib/editor/tinymce/db/upgrade.php index cb8a9558a75..c97f9beca3f 100644 --- a/lib/editor/tinymce/db/upgrade.php +++ b/lib/editor/tinymce/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_editor_tinymce_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php b/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php index d658dee8bd6..a8844860d93 100644 --- a/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php +++ b/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_tinymce_spellchecker_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/message/output/email/db/upgrade.php b/message/output/email/db/upgrade.php index c4932654259..777fd61aaaa 100644 --- a/message/output/email/db/upgrade.php +++ b/message/output/email/db/upgrade.php @@ -34,9 +34,6 @@ function xmldb_message_email_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/message/output/jabber/db/upgrade.php b/message/output/jabber/db/upgrade.php index 64cf7d20717..b3338d94aef 100644 --- a/message/output/jabber/db/upgrade.php +++ b/message/output/jabber/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_message_jabber_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/message/output/popup/db/upgrade.php b/message/output/popup/db/upgrade.php index 2c6324a5339..b5b7add3553 100644 --- a/message/output/popup/db/upgrade.php +++ b/message/output/popup/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_message_popup_upgrade($oldversion) { global $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/assign/db/upgrade.php b/mod/assign/db/upgrade.php index a7070a7145c..633546e392b 100644 --- a/mod/assign/db/upgrade.php +++ b/mod/assign/db/upgrade.php @@ -34,9 +34,6 @@ function xmldb_assign_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/assign/feedback/comments/db/upgrade.php b/mod/assign/feedback/comments/db/upgrade.php index a824628efc7..7b6cdfa679c 100644 --- a/mod/assign/feedback/comments/db/upgrade.php +++ b/mod/assign/feedback/comments/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_assignfeedback_comments_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/assign/feedback/editpdf/db/upgrade.php b/mod/assign/feedback/editpdf/db/upgrade.php index 9d915c0c6c1..a289bb0c4f3 100644 --- a/mod/assign/feedback/editpdf/db/upgrade.php +++ b/mod/assign/feedback/editpdf/db/upgrade.php @@ -34,42 +34,6 @@ function xmldb_assignfeedback_editpdf_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2018051401) { - $table = new xmldb_table('assignfeedback_editpdf_queue'); - $field = new xmldb_field('attemptedconversions', XMLDB_TYPE_INTEGER, '10', null, - XMLDB_NOTNULL, null, 0, 'submissionattempt'); - - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Attempts are removed from the queue after being processed, a duplicate row won't achieve anything productive. - // So look for any duplicates and remove them so we can add a unique key. - $sql = "SELECT MIN(id) as minid, submissionid, submissionattempt - FROM {assignfeedback_editpdf_queue} - GROUP BY submissionid, submissionattempt - HAVING COUNT(id) > 1"; - - if ($duplicatedrows = $DB->get_recordset_sql($sql)) { - foreach ($duplicatedrows as $row) { - $DB->delete_records_select('assignfeedback_editpdf_queue', - 'submissionid = :submissionid AND submissionattempt = :submissionattempt AND id <> :minid', (array)$row); - } - } - $duplicatedrows->close(); - - // Define key submissionid-submissionattempt to be added to assignfeedback_editpdf_queue. - $table = new xmldb_table('assignfeedback_editpdf_queue'); - $key = new xmldb_key('submissionid-submissionattempt', XMLDB_KEY_UNIQUE, ['submissionid', 'submissionattempt']); - - $dbman->add_key($table, $key); - - upgrade_plugin_savepoint(true, 2018051401, 'assignfeedback', 'editpdf'); - } - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/assign/feedback/file/db/upgrade.php b/mod/assign/feedback/file/db/upgrade.php index 69bac821b53..25dca633bc1 100644 --- a/mod/assign/feedback/file/db/upgrade.php +++ b/mod/assign/feedback/file/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_assignfeedback_file_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/assign/submission/comments/db/upgrade.php b/mod/assign/submission/comments/db/upgrade.php index e00fe84a44e..7b2e92de9d1 100644 --- a/mod/assign/submission/comments/db/upgrade.php +++ b/mod/assign/submission/comments/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_assignsubmission_comments_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/assign/submission/file/db/upgrade.php b/mod/assign/submission/file/db/upgrade.php index c6d46ad18c3..a41274f841c 100644 --- a/mod/assign/submission/file/db/upgrade.php +++ b/mod/assign/submission/file/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_assignsubmission_file_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/assign/submission/onlinetext/db/upgrade.php b/mod/assign/submission/onlinetext/db/upgrade.php index 52b0e0da4e6..020a7dc09a5 100644 --- a/mod/assign/submission/onlinetext/db/upgrade.php +++ b/mod/assign/submission/onlinetext/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_assignsubmission_onlinetext_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/assignment/db/upgrade.php b/mod/assignment/db/upgrade.php index 25513d5dc3c..634ab34d956 100644 --- a/mod/assignment/db/upgrade.php +++ b/mod/assignment/db/upgrade.php @@ -24,9 +24,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_assignment_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/book/db/upgrade.php b/mod/book/db/upgrade.php index 89f68453e09..b2ede5890f9 100644 --- a/mod/book/db/upgrade.php +++ b/mod/book/db/upgrade.php @@ -34,9 +34,6 @@ function xmldb_book_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/chat/db/upgrade.php b/mod/chat/db/upgrade.php index 93a95fd377f..f1af1b84f07 100644 --- a/mod/chat/db/upgrade.php +++ b/mod/chat/db/upgrade.php @@ -27,9 +27,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_chat_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/choice/db/upgrade.php b/mod/choice/db/upgrade.php index 0ed920c5137..5ed2d25d3c0 100644 --- a/mod/choice/db/upgrade.php +++ b/mod/choice/db/upgrade.php @@ -26,9 +26,6 @@ function xmldb_choice_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php index 52156e4c42b..59cec179c7e 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -24,9 +24,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_data_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/feedback/db/upgrade.php b/mod/feedback/db/upgrade.php index 77e366b45a3..26be0a5712b 100644 --- a/mod/feedback/db/upgrade.php +++ b/mod/feedback/db/upgrade.php @@ -44,9 +44,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_feedback_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/folder/db/upgrade.php b/mod/folder/db/upgrade.php index 5323cd840c6..f42662b2740 100644 --- a/mod/folder/db/upgrade.php +++ b/mod/folder/db/upgrade.php @@ -49,9 +49,6 @@ function xmldb_folder_upgrade($oldversion) { $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/forum/db/upgrade.php b/mod/forum/db/upgrade.php index 18ad8b8218f..505be0aaf52 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -47,9 +47,6 @@ function xmldb_forum_upgrade($oldversion) { $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/glossary/db/upgrade.php b/mod/glossary/db/upgrade.php index 0f786112de6..56481c9b21a 100644 --- a/mod/glossary/db/upgrade.php +++ b/mod/glossary/db/upgrade.php @@ -22,75 +22,6 @@ function xmldb_glossary_upgrade($oldversion) { global $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2018051401) { - - // Fetch the module ID for the glossary module. - $glossarymoduleid = $DB->get_field('modules', 'id', ['name' => 'glossary']); - - // Get id of section 1 on the frontpage course. - $fpsection1 = $DB->get_field('course_sections', 'id', ['course' => SITEID, 'section' => 1]); - - // Fetch sections for the frontpage not matching 1. - $sectionselect = 'course = :course AND section <> 1'; - $sitesections = $DB->get_recordset_select('course_sections', $sectionselect, ['course' => SITEID]); - $newsection1cmids = []; - foreach ($sitesections as $section) { - // Check if we have anything to process for this section. - if (empty($section->sequence)) { - // If there's none, ignore. - continue; - } - // Fetch the course module IDs of the course modules in the section. - $cmids = explode(',', $section->sequence); - $nonglossarycmids = []; - // Update the section in the course_modules table for glossary instances if necessary. - foreach ($cmids as $cmid) { - $params = [ - 'id' => $cmid, - 'module' => $glossarymoduleid - ]; - // Check if the record in the course_modules tables is that of a glossary activity. - if ($DB->record_exists('course_modules', $params)) { - // If so, move it to front page's section 1. - $DB->set_field('course_modules', 'section', $fpsection1, $params); - $newsection1cmids[] = $cmid; - } else { - // Otherwise, ignore this course module as we only want to update glossary items. - $nonglossarycmids[] = $cmid; - } - } - // Check if we need to update the section record or we can delete it. - if (!empty($nonglossarycmids)) { - // Update the section record with a sequence that now excludes the glossary instance(s) (if it changed). - $sequence = implode(',', $nonglossarycmids); - if ($sequence != $section->sequence) { - $DB->set_field('course_sections', 'sequence', $sequence, ['id' => $section->id]); - } - } else { - // This section doesn't contain any items anymore, we can remove this. - $DB->delete_records('course_sections', ['id' => $section->id]); - } - } - $sitesections->close(); - - // Update the sequence field for the site's section 1 if necessary. - if (!empty($newsection1cmids)) { - $section1params = [ - 'course' => SITEID, - 'section' => 1 - ]; - $section1sequence = $DB->get_field('course_sections', 'sequence', $section1params); - $newsection1sequence = implode(',', array_merge([$section1sequence], $newsection1cmids)); - // Update the sequence field of the first section for the front page. - $DB->set_field('course_sections', 'sequence', $newsection1sequence, $section1params); - } - - upgrade_mod_savepoint(true, 2018051401, 'glossary'); - } - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/imscp/db/upgrade.php b/mod/imscp/db/upgrade.php index cd3574b4ced..0410901c7e5 100644 --- a/mod/imscp/db/upgrade.php +++ b/mod/imscp/db/upgrade.php @@ -31,9 +31,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_imscp_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/label/db/upgrade.php b/mod/label/db/upgrade.php index 0045a6b4f91..b6d5a8c006c 100644 --- a/mod/label/db/upgrade.php +++ b/mod/label/db/upgrade.php @@ -47,9 +47,6 @@ defined('MOODLE_INTERNAL') || die; function xmldb_label_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/lesson/db/upgrade.php b/mod/lesson/db/upgrade.php index 9efcff7cf9e..e3f80a84c61 100644 --- a/mod/lesson/db/upgrade.php +++ b/mod/lesson/db/upgrade.php @@ -52,9 +52,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_lesson_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/lti/db/upgrade.php b/mod/lti/db/upgrade.php index 9136daa831a..b8b44438518 100644 --- a/mod/lti/db/upgrade.php +++ b/mod/lti/db/upgrade.php @@ -63,9 +63,6 @@ function xmldb_lti_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/page/db/upgrade.php b/mod/page/db/upgrade.php index 32929056956..f517efc5686 100644 --- a/mod/page/db/upgrade.php +++ b/mod/page/db/upgrade.php @@ -47,9 +47,6 @@ defined('MOODLE_INTERNAL') || die; function xmldb_page_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/quiz/db/upgrade.php b/mod/quiz/db/upgrade.php index cafd6329929..14d9f67ec18 100644 --- a/mod/quiz/db/upgrade.php +++ b/mod/quiz/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_quiz_upgrade($oldversion) { global $CFG, $DB; $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/quiz/report/overview/db/upgrade.php b/mod/quiz/report/overview/db/upgrade.php index b15b9174e86..cdf99dcdab6 100644 --- a/mod/quiz/report/overview/db/upgrade.php +++ b/mod/quiz/report/overview/db/upgrade.php @@ -33,43 +33,6 @@ function xmldb_quiz_overview_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - - // Upgrade 2018021800 (now removed) incorrectly added this key - // with a unique constraint, which breaks things because those - // columns are not, in fact, unique. So drop (if it exists) then recreate. - if ($oldversion < 2018061800) { - - // Define key questionusageid-slot (foreign) to be dropped form quiz_overview_regrades. - $table = new xmldb_table('quiz_overview_regrades'); - - // There is no key_exists, so test the equivalent index. - $oldindex = new xmldb_index('questionusageid-slot', XMLDB_KEY_UNIQUE, array('questionusageid', 'slot')); - - // Launch drop key questionusageid-slot. - if ($dbman->index_exists($table, $oldindex)) { - $key = new xmldb_key('questionusageid-slot', XMLDB_KEY_FOREIGN, array('questionusageid', 'slot'), 'question_attempts', array('questionusageid', 'slot')); - $dbman->drop_key($table, $key); - } - - // Overview savepoint reached. - upgrade_plugin_savepoint(true, 2018061800, 'quiz', 'overview'); - } - - if ($oldversion < 2018061801) { - - // Define key questionusageid-slot (foreign) to be added to quiz_overview_regrades. - $table = new xmldb_table('quiz_overview_regrades'); - $key = new xmldb_key('questionusageid-slot', XMLDB_KEY_FOREIGN, array('questionusageid', 'slot'), 'question_attempts', array('questionusageid', 'slot')); - - // Launch add key questionusageid-slot. - $dbman->add_key($table, $key); - - // Overview savepoint reached. - upgrade_plugin_savepoint(true, 2018061801, 'quiz', 'overview'); - } - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/quiz/report/statistics/db/upgrade.php b/mod/quiz/report/statistics/db/upgrade.php index da25fdb33d5..163fcddecce 100644 --- a/mod/quiz/report/statistics/db/upgrade.php +++ b/mod/quiz/report/statistics/db/upgrade.php @@ -30,9 +30,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_quiz_statistics_upgrade($oldversion) { global $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/resource/db/upgrade.php b/mod/resource/db/upgrade.php index eae895f2b32..300944c570c 100644 --- a/mod/resource/db/upgrade.php +++ b/mod/resource/db/upgrade.php @@ -47,9 +47,6 @@ defined('MOODLE_INTERNAL') || die; function xmldb_resource_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/scorm/db/upgrade.php b/mod/scorm/db/upgrade.php index 8ad79b907f6..27a07bf31a8 100644 --- a/mod/scorm/db/upgrade.php +++ b/mod/scorm/db/upgrade.php @@ -34,9 +34,6 @@ function xmldb_scorm_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/survey/db/upgrade.php b/mod/survey/db/upgrade.php index 585ddd1638d..e8fc99b0368 100644 --- a/mod/survey/db/upgrade.php +++ b/mod/survey/db/upgrade.php @@ -24,9 +24,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_survey_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/url/db/upgrade.php b/mod/url/db/upgrade.php index c87b6676dd7..3ab66547ca5 100644 --- a/mod/url/db/upgrade.php +++ b/mod/url/db/upgrade.php @@ -47,9 +47,6 @@ defined('MOODLE_INTERNAL') || die; function xmldb_url_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/wiki/db/upgrade.php b/mod/wiki/db/upgrade.php index 11c9b217d63..003afe5ed23 100644 --- a/mod/wiki/db/upgrade.php +++ b/mod/wiki/db/upgrade.php @@ -40,9 +40,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_wiki_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/workshop/db/upgrade.php b/mod/workshop/db/upgrade.php index 0ae1705d925..676f0ad052a 100644 --- a/mod/workshop/db/upgrade.php +++ b/mod/workshop/db/upgrade.php @@ -39,50 +39,6 @@ function xmldb_workshop_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - - if ($oldversion < 2018062600) { - - // Define field submissiontypetext to be added to workshop. - $table = new xmldb_table('workshop'); - $field = new xmldb_field('submissiontypetext', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1', 'gradedecimals'); - - // Conditionally launch add field submissiontypetext. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - $field = new xmldb_field('submissiontypefile', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1', - 'submissiontypetext'); - - // Conditionally launch add field submissiontypefile. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Convert existing workshops with attachments disabled to use the new settings. - $workshops = $DB->get_records('workshop', ['nattachments' => 0]); - foreach ($workshops as $workshop) { - $update = (object) [ - 'id' => $workshop->id, - 'submissiontypefile' => 0, - 'submissiontypetext' => 2, - 'nattachments' => 1 - ]; - $DB->update_record('workshop', $update); - } - - // Changing the default of field nattachments on table workshop to 1. - $field = new xmldb_field('nattachments', XMLDB_TYPE_INTEGER, '3', null, null, null, '1', 'submissiontypefile'); - - // Launch change of default for field nattachments. - $dbman->change_field_default($table, $field); - - // Workshop savepoint reached. - upgrade_mod_savepoint(true, 2018062600, 'workshop'); - } - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/workshop/form/accumulative/db/upgrade.php b/mod/workshop/form/accumulative/db/upgrade.php index 57cdeaad0e3..f92dec5b747 100644 --- a/mod/workshop/form/accumulative/db/upgrade.php +++ b/mod/workshop/form/accumulative/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_workshopform_accumulative_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/workshop/form/comments/db/upgrade.php b/mod/workshop/form/comments/db/upgrade.php index ee551018974..f14b7ffd3a8 100644 --- a/mod/workshop/form/comments/db/upgrade.php +++ b/mod/workshop/form/comments/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_workshopform_comments_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/workshop/form/numerrors/db/upgrade.php b/mod/workshop/form/numerrors/db/upgrade.php index 323e966b187..348dda1a725 100644 --- a/mod/workshop/form/numerrors/db/upgrade.php +++ b/mod/workshop/form/numerrors/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_workshopform_numerrors_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/mod/workshop/form/rubric/db/upgrade.php b/mod/workshop/form/rubric/db/upgrade.php index ee17da73e1e..6b9d4edc75e 100644 --- a/mod/workshop/form/rubric/db/upgrade.php +++ b/mod/workshop/form/rubric/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_workshopform_rubric_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/portfolio/boxnet/db/upgrade.php b/portfolio/boxnet/db/upgrade.php index 45c095b0742..ad33d85391e 100644 --- a/portfolio/boxnet/db/upgrade.php +++ b/portfolio/boxnet/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_portfolio_boxnet_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/portfolio/googledocs/db/upgrade.php b/portfolio/googledocs/db/upgrade.php index d09c71dc5ec..0978a4a851b 100644 --- a/portfolio/googledocs/db/upgrade.php +++ b/portfolio/googledocs/db/upgrade.php @@ -23,9 +23,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_portfolio_googledocs_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/portfolio/picasa/db/upgrade.php b/portfolio/picasa/db/upgrade.php index 1d0a02b9a53..4f78ab82985 100644 --- a/portfolio/picasa/db/upgrade.php +++ b/portfolio/picasa/db/upgrade.php @@ -23,9 +23,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_portfolio_picasa_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/behaviour/manualgraded/db/upgrade.php b/question/behaviour/manualgraded/db/upgrade.php index 4743e9dd896..f01213d6e99 100644 --- a/question/behaviour/manualgraded/db/upgrade.php +++ b/question/behaviour/manualgraded/db/upgrade.php @@ -30,9 +30,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qbehaviour_manualgraded_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/calculated/db/upgrade.php b/question/type/calculated/db/upgrade.php index e4bad210ebd..b722aaa1ce9 100644 --- a/question/type/calculated/db/upgrade.php +++ b/question/type/calculated/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_calculated_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/ddmarker/db/upgrade.php b/question/type/ddmarker/db/upgrade.php index 33c1e0f38e9..8628aaa0c4a 100644 --- a/question/type/ddmarker/db/upgrade.php +++ b/question/type/ddmarker/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_ddmarker_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/essay/db/upgrade.php b/question/type/essay/db/upgrade.php index 432f2dab87c..f06dc43ea73 100644 --- a/question/type/essay/db/upgrade.php +++ b/question/type/essay/db/upgrade.php @@ -32,8 +32,7 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_essay_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. + $dbman = $DB->get_manager(); // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. @@ -47,7 +46,6 @@ function xmldb_qtype_essay_upgrade($oldversion) { // Automatically generated Moodle v3.9.0 release upgrade line. // Put any upgrade step following this. - $dbman = $DB->get_manager(); if ($oldversion < 2020091600) { // Define field maxbytes to be added to qtype_essay_options. diff --git a/question/type/match/db/upgrade.php b/question/type/match/db/upgrade.php index e23469c06a9..bdb941a99aa 100644 --- a/question/type/match/db/upgrade.php +++ b/question/type/match/db/upgrade.php @@ -31,9 +31,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_match_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/multianswer/db/upgrade.php b/question/type/multianswer/db/upgrade.php index 76b6706657c..6ca7b26587f 100644 --- a/question/type/multianswer/db/upgrade.php +++ b/question/type/multianswer/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_multianswer_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/multichoice/db/upgrade.php b/question/type/multichoice/db/upgrade.php index 6c822b4cd18..cd24fcabc65 100644 --- a/question/type/multichoice/db/upgrade.php +++ b/question/type/multichoice/db/upgrade.php @@ -32,8 +32,7 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_multichoice_upgrade($oldversion) { global $CFG, $DB; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. + $dbman = $DB->get_manager(); // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. @@ -46,7 +45,6 @@ function xmldb_qtype_multichoice_upgrade($oldversion) { // Add a new checkbox for the question author to decide // Whether standard instruction ('Select one:' or 'Select one or more:') is displayed. - $dbman = $DB->get_manager(); $newversion = 2020041600; if ($oldversion < $newversion) { diff --git a/question/type/numerical/db/upgrade.php b/question/type/numerical/db/upgrade.php index dc61f1f1f12..a47cc01fa92 100644 --- a/question/type/numerical/db/upgrade.php +++ b/question/type/numerical/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_numerical_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/random/db/upgrade.php b/question/type/random/db/upgrade.php index e57af2d4a5a..fa43bef154c 100644 --- a/question/type/random/db/upgrade.php +++ b/question/type/random/db/upgrade.php @@ -31,9 +31,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_random_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/randomsamatch/db/upgrade.php b/question/type/randomsamatch/db/upgrade.php index 8e15916c53f..47941f87378 100644 --- a/question/type/randomsamatch/db/upgrade.php +++ b/question/type/randomsamatch/db/upgrade.php @@ -31,9 +31,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_randomsamatch_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/shortanswer/db/upgrade.php b/question/type/shortanswer/db/upgrade.php index 6432403b1d8..8e154c2ea90 100644 --- a/question/type/shortanswer/db/upgrade.php +++ b/question/type/shortanswer/db/upgrade.php @@ -32,9 +32,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_qtype_shortanswer_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/repository/boxnet/db/upgrade.php b/repository/boxnet/db/upgrade.php index 5f29b5832f3..733e754f339 100644 --- a/repository/boxnet/db/upgrade.php +++ b/repository/boxnet/db/upgrade.php @@ -33,9 +33,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_repository_boxnet_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/repository/dropbox/db/upgrade.php b/repository/dropbox/db/upgrade.php index e3372d62ac3..453694011e0 100644 --- a/repository/dropbox/db/upgrade.php +++ b/repository/dropbox/db/upgrade.php @@ -23,9 +23,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_repository_dropbox_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/repository/flickr/db/upgrade.php b/repository/flickr/db/upgrade.php index 8d8c285e7b1..10d68360d30 100644 --- a/repository/flickr/db/upgrade.php +++ b/repository/flickr/db/upgrade.php @@ -34,9 +34,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_repository_flickr_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/repository/googledocs/db/upgrade.php b/repository/googledocs/db/upgrade.php index 5c20f2eff39..b3a28c448b2 100644 --- a/repository/googledocs/db/upgrade.php +++ b/repository/googledocs/db/upgrade.php @@ -23,9 +23,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_repository_googledocs_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/repository/onedrive/db/upgrade.php b/repository/onedrive/db/upgrade.php index d1a1f5c03b2..6a34d49bdd4 100644 --- a/repository/onedrive/db/upgrade.php +++ b/repository/onedrive/db/upgrade.php @@ -26,9 +26,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_repository_onedrive_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. diff --git a/repository/picasa/db/upgrade.php b/repository/picasa/db/upgrade.php index 3132a096be9..badbbf42a9b 100644 --- a/repository/picasa/db/upgrade.php +++ b/repository/picasa/db/upgrade.php @@ -23,9 +23,6 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_repository_picasa_upgrade($oldversion) { global $CFG; - // Automatically generated Moodle v3.5.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this.