diff --git a/admin/tool/customlang/db/upgrade.php b/admin/tool/customlang/db/upgrade.php index 1c04587877819..a7ff6a37ce25c 100644 --- a/admin/tool/customlang/db/upgrade.php +++ b/admin/tool/customlang/db/upgrade.php @@ -29,9 +29,6 @@ function xmldb_tool_customlang_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 fc1e3d129c459..06d74414b7232 100644 --- a/admin/tool/log/db/upgrade.php +++ b/admin/tool/log/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_tool_log_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 8f014cf9a2190..f9c8a8b3d5bf9 100644 --- a/admin/tool/log/store/database/db/upgrade.php +++ b/admin/tool/log/store/database/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_logstore_database_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 8880f59aec3ac..610b61ce2b763 100644 --- a/admin/tool/log/store/standard/db/upgrade.php +++ b/admin/tool/log/store/standard/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_logstore_standard_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 6fbca49435c86..1358647a172a0 100644 --- a/admin/tool/monitor/db/upgrade.php +++ b/admin/tool/monitor/db/upgrade.php @@ -35,9 +35,6 @@ function xmldb_tool_monitor_upgrade($oldversion) { $dbman = $DB->get_manager(); - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016052305) { // Define field inactivedate to be added to tool_monitor_subscriptions. diff --git a/auth/cas/db/upgrade.php b/auth/cas/db/upgrade.php index 167c76b78a48d..f3999b3534247 100644 --- a/auth/cas/db/upgrade.php +++ b/auth/cas/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_auth_cas_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 6811fd71ebf70..02f1323217fc8 100644 --- a/auth/ldap/db/upgrade.php +++ b/auth/ldap/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_auth_ldap_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 50a52669d090f..03dbdb2459c3c 100644 --- a/auth/manual/db/upgrade.php +++ b/auth/manual/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_auth_manual_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 925124e1bdcd1..9db6da9e49125 100644 --- a/auth/mnet/db/upgrade.php +++ b/auth/mnet/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_auth_mnet_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.0 release upgrade line. // Put any upgrade step following this. if ($oldversion < 2017020700) { diff --git a/blocks/badges/db/upgrade.php b/blocks/badges/db/upgrade.php index 980e5f9d24dfe..bb9b3cfdfebff 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; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 397cb907b3bfa..4403a7728edfb 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; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 e7aa7fee49e94..dbe19a5d17c24 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; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.0 release upgrade line. // Put any upgrade step following this. diff --git a/blocks/community/db/upgrade.php b/blocks/community/db/upgrade.php index f5f0ae31ab376..d01face15a677 100644 --- a/blocks/community/db/upgrade.php +++ b/blocks/community/db/upgrade.php @@ -46,9 +46,6 @@ function xmldb_block_community_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 c74148a56cd30..f0837fc410875 100644 --- a/blocks/completionstatus/db/upgrade.php +++ b/blocks/completionstatus/db/upgrade.php @@ -48,9 +48,6 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 9186a4034f98c..763a538e4035e 100644 --- a/blocks/course_summary/db/upgrade.php +++ b/blocks/course_summary/db/upgrade.php @@ -48,9 +48,6 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 e386f20e09471..5ad7f2231d5f4 100644 --- a/blocks/html/db/upgrade.php +++ b/blocks/html/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_block_html_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 04dc1104308ac..07b438187de33 100644 --- a/blocks/navigation/db/upgrade.php +++ b/blocks/navigation/db/upgrade.php @@ -55,9 +55,6 @@ function xmldb_block_navigation_upgrade($oldversion, $block) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 0bf77eb923d32..18ee857203528 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; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 4a9f5fb26bc2f..d9bf4079134c7 100644 --- a/blocks/recent_activity/db/upgrade.php +++ b/blocks/recent_activity/db/upgrade.php @@ -47,9 +47,6 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 518fffa13c01b..d968dda83b0da 100644 --- a/blocks/rss_client/db/upgrade.php +++ b/blocks/rss_client/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_block_rss_client_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 f0d55342790ca..02000324f157a 100644 --- a/blocks/section_links/db/upgrade.php +++ b/blocks/section_links/db/upgrade.php @@ -49,9 +49,6 @@ function xmldb_block_section_links_upgrade($oldversion, $block) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 1f0f0a75c0741..7e5e56ab3d073 100644 --- a/blocks/selfcompletion/db/upgrade.php +++ b/blocks/selfcompletion/db/upgrade.php @@ -48,9 +48,6 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 ba3726674f9d3..2a9dcebd050b3 100644 --- a/blocks/settings/db/upgrade.php +++ b/blocks/settings/db/upgrade.php @@ -55,9 +55,6 @@ function xmldb_block_settings_upgrade($oldversion, $block) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 c38575a96eee9..351cf6685d475 100644 --- a/enrol/database/db/upgrade.php +++ b/enrol/database/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_enrol_database_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 91ea55bd0243a..59ae42e1dee66 100644 --- a/enrol/flatfile/db/upgrade.php +++ b/enrol/flatfile/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_enrol_flatfile_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 51a3a0bf9c40e..cb6fb76a24640 100644 --- a/enrol/guest/db/upgrade.php +++ b/enrol/guest/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_enrol_guest_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 53366c6a37539..a4e1df7685d9b 100644 --- a/enrol/imsenterprise/db/upgrade.php +++ b/enrol/imsenterprise/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_enrol_imsenterprise_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 0086edfb6aa8b..cec4ea435af90 100644 --- a/enrol/manual/db/upgrade.php +++ b/enrol/manual/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_enrol_manual_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 29f85644b1804..6f22ccae2f6df 100644 --- a/enrol/mnet/db/upgrade.php +++ b/enrol/mnet/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_enrol_mnet_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 5ed2ae764a5ae..bdbbbf6d3642e 100644 --- a/enrol/paypal/db/upgrade.php +++ b/enrol/paypal/db/upgrade.php @@ -45,9 +45,6 @@ function xmldb_enrol_paypal_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 f9dff597c9167..49652986ddac2 100644 --- a/enrol/self/db/upgrade.php +++ b/enrol/self/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_enrol_self_upgrade($oldversion) { global $CFG, $DB; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016052301) { // Get roles with manager archetype. $managerroles = get_archetype_roles('manager'); diff --git a/filter/mathjaxloader/db/upgrade.php b/filter/mathjaxloader/db/upgrade.php index 7edde8a465130..5294046655b6b 100644 --- a/filter/mathjaxloader/db/upgrade.php +++ b/filter/mathjaxloader/db/upgrade.php @@ -33,26 +33,6 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) { require_once($CFG->dirroot . '/filter/mathjaxloader/db/upgradelib.php'); - if ($oldversion < 2016032200) { - - $httpurl = get_config('filter_mathjaxloader', 'httpurl'); - // Don't change the config if it has been manually changed to something besides the default setting value. - if ($httpurl === "http://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js") { - set_config('httpurl', 'http://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js', 'filter_mathjaxloader'); - } - - $httpsurl = get_config('filter_mathjaxloader', 'httpsurl'); - // Don't change the config if it has been manually changed to something besides the default setting value. - if ($httpsurl === "https://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js") { - set_config('httpsurl', 'https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js', 'filter_mathjaxloader'); - } - - upgrade_plugin_savepoint(true, 2016032200, 'filter', 'mathjaxloader'); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016080200) { // We are consolodating the two settings for http and https url into only the https // setting. Since it is preferably to always load the secure resource. @@ -78,8 +58,10 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) { } upgrade_plugin_savepoint(true, 2016102500, 'filter', 'mathjaxloader'); } + // Automatically generated Moodle v3.2.0 release upgrade line. // Put any upgrade step following this. + // if ($oldversion < 2017040300) { $httpsurl = get_config('filter_mathjaxloader', 'httpsurl'); @@ -97,6 +79,7 @@ function xmldb_filter_mathjaxloader_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2017040300, 'filter', 'mathjaxloader'); } + if ($oldversion < 2017042602) { $httpsurl = get_config('filter_mathjaxloader', 'httpsurl'); diff --git a/filter/mediaplugin/db/upgrade.php b/filter/mediaplugin/db/upgrade.php index 8b581393821e0..c89fab927666c 100644 --- a/filter/mediaplugin/db/upgrade.php +++ b/filter/mediaplugin/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_filter_mediaplugin_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 459183d55f20a..53cc010536714 100644 --- a/filter/tex/db/upgrade.php +++ b/filter/tex/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_filter_tex_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 68f39ad2b3dd5..5677911df8545 100644 --- a/grade/grading/form/guide/db/upgrade.php +++ b/grade/grading/form/guide/db/upgrade.php @@ -37,18 +37,6 @@ function xmldb_gradingform_guide_upgrade($oldversion) { global $DB; - if ($oldversion < 2016051100) { - // Clean up empty string or null marking guide comments. - $sql = $DB->sql_isempty('gradingform_guide_comments', 'description', true, true); - $sql .= " OR description IS NULL "; - $DB->delete_records_select('gradingform_guide_comments', $sql); - // Main savepoint reached. - upgrade_plugin_savepoint(true, 2016051100, 'gradingform', 'guide'); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 bab220da94807..92e65e3848d70 100644 --- a/grade/grading/form/rubric/db/upgrade.php +++ b/grade/grading/form/rubric/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_gradingform_rubric_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 3e662baed4552..ea9d000bb9ef4 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; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 c35f1cac26a61..e1b678b4242fc 100644 --- a/lib/antivirus/clamav/db/upgrade.php +++ b/lib/antivirus/clamav/db/upgrade.php @@ -31,8 +31,6 @@ * @return bool */ function xmldb_antivirus_clamav_upgrade($oldversion) { - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. if ($oldversion < 2016101700) { // Remove setting that has been deprecated long time ago at MDL-44260. diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 88cdee7d0b986..c346a9ab316d2 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -92,1005 +92,15 @@ 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.0.0 right now). - if ($oldversion < 2015111600) { + // allowed version to upgrade from (v3.1.0 right now). + if ($oldversion < 2016052300) { // Just in case somebody hacks upgrade scripts or env, we really can not continue. - echo("You need to upgrade to 3.0.x or higher first!\n"); + echo("You need to upgrade to 3.1.x or higher first!\n"); exit(1); // Note this savepoint is 100% unreachable, but needed to pass the upgrade checks. - upgrade_main_savepoint(true, 2015111600); + upgrade_main_savepoint(true, 2016052300); } - if ($oldversion < 2016011300.01) { - - // This is a big upgrade script. We create new table tag_coll and the field - // tag.tagcollid pointing to it. - - // Define table tag_coll to be created. - $table = new xmldb_table('tag_coll'); - - // Adding fields to table tagcloud. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('name', XMLDB_TYPE_CHAR, '255', null, null, null, null); - $table->add_field('isdefault', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('component', XMLDB_TYPE_CHAR, '100', null, null, null, null); - $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '5', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('searchable', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '1'); - $table->add_field('customurl', XMLDB_TYPE_CHAR, '255', null, null, null, null); - - // Adding keys to table tagcloud. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Conditionally launch create table for tagcloud. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Table {tag}. - // Define index name (unique) to be dropped form tag - we will replace it with index on (tagcollid,name) later. - $table = new xmldb_table('tag'); - $index = new xmldb_index('name', XMLDB_INDEX_UNIQUE, array('name')); - - // Conditionally launch drop index name. - if ($dbman->index_exists($table, $index)) { - $dbman->drop_index($table, $index); - } - - // Define field tagcollid to be added to tag, we create it as null first and will change to notnull later. - $table = new xmldb_table('tag'); - $field = new xmldb_field('tagcollid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'userid'); - - // Conditionally launch add field tagcloudid. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016011300.01); - } - - if ($oldversion < 2016011300.02) { - // Create a default tag collection if not exists and update the field tag.tagcollid to point to it. - if (!$tcid = $DB->get_field_sql('SELECT id FROM {tag_coll} ORDER BY isdefault DESC, sortorder, id', null, - IGNORE_MULTIPLE)) { - $tcid = $DB->insert_record('tag_coll', array('isdefault' => 1, 'sortorder' => 0)); - } - $DB->execute('UPDATE {tag} SET tagcollid = ? WHERE tagcollid IS NULL', array($tcid)); - - // Define index tagcollname (unique) to be added to tag. - $table = new xmldb_table('tag'); - $index = new xmldb_index('tagcollname', XMLDB_INDEX_UNIQUE, array('tagcollid', 'name')); - $field = new xmldb_field('tagcollid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'userid'); - - // Conditionally launch add index tagcollname. - if (!$dbman->index_exists($table, $index)) { - // Launch change of nullability for field tagcollid. - $dbman->change_field_notnull($table, $field); - $dbman->add_index($table, $index); - } - - // Define key tagcollid (foreign) to be added to tag. - $table = new xmldb_table('tag'); - $key = new xmldb_key('tagcollid', XMLDB_KEY_FOREIGN, array('tagcollid'), 'tag_coll', array('id')); - - // Launch add key tagcloudid. - $dbman->add_key($table, $key); - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016011300.02); - } - - if ($oldversion < 2016011300.03) { - - // Define table tag_area to be created. - $table = new xmldb_table('tag_area'); - - // Adding fields to table tag_area. - $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('enabled', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '1'); - $table->add_field('tagcollid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('callback', XMLDB_TYPE_CHAR, '100', null, null, null, null); - $table->add_field('callbackfile', XMLDB_TYPE_CHAR, '100', null, null, null, null); - - // Adding keys to table tag_area. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('tagcollid', XMLDB_KEY_FOREIGN, array('tagcollid'), 'tag_coll', array('id')); - - // Adding indexes to table tag_area. - $table->add_index('compitemtype', XMLDB_INDEX_UNIQUE, array('component', 'itemtype')); - - // Conditionally launch create table for tag_area. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016011300.03); - } - - if ($oldversion < 2016011300.04) { - - // Define index itemtype-itemid-tagid-tiuserid (unique) to be dropped form tag_instance. - $table = new xmldb_table('tag_instance'); - $index = new xmldb_index('itemtype-itemid-tagid-tiuserid', XMLDB_INDEX_UNIQUE, - array('itemtype', 'itemid', 'tagid', 'tiuserid')); - - // Conditionally launch drop index itemtype-itemid-tagid-tiuserid. - if ($dbman->index_exists($table, $index)) { - $dbman->drop_index($table, $index); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016011300.04); - } - - if ($oldversion < 2016011300.05) { - - $DB->execute("UPDATE {tag_instance} SET component = ? WHERE component IS NULL", array('')); - - // Changing nullability of field component on table tag_instance to not null. - $table = new xmldb_table('tag_instance'); - $field = new xmldb_field('component', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null, 'tagid'); - - // Launch change of nullability for field component. - $dbman->change_field_notnull($table, $field); - - // Changing type of field itemtype on table tag_instance to char. - $table = new xmldb_table('tag_instance'); - $field = new xmldb_field('itemtype', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null, 'component'); - - // Launch change of type for field itemtype. - $dbman->change_field_type($table, $field); - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016011300.05); - } - - if ($oldversion < 2016011300.06) { - - // Define index taggeditem (unique) to be added to tag_instance. - $table = new xmldb_table('tag_instance'); - $index = new xmldb_index('taggeditem', XMLDB_INDEX_UNIQUE, array('component', 'itemtype', 'itemid', 'tiuserid', 'tagid')); - - // Conditionally launch add index taggeditem. - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016011300.06); - } - - if ($oldversion < 2016011300.07) { - - // Define index taglookup (not unique) to be added to tag_instance. - $table = new xmldb_table('tag_instance'); - $index = new xmldb_index('taglookup', XMLDB_INDEX_NOTUNIQUE, array('itemtype', 'component', 'tagid', 'contextid')); - - // Conditionally launch add index taglookup. - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016011300.07); - } - - if ($oldversion < 2016011301.00) { - - // Force uninstall of deleted tool. - if (!file_exists("$CFG->dirroot/webservice/amf")) { - // Remove capabilities. - capabilities_cleanup('webservice_amf'); - // Remove all other associated config. - unset_all_config_for_plugin('webservice_amf'); - } - upgrade_main_savepoint(true, 2016011301.00); - } - - if ($oldversion < 2016011901.00) { - - // Convert calendar_lookahead to nearest new value. - $transaction = $DB->start_delegated_transaction(); - - // Count all users who curretly have that preference set (for progress bar). - $total = $DB->count_records_select('user_preferences', "name = 'calendar_lookahead' AND value != '0'"); - $pbar = new progress_bar('upgradecalendarlookahead', 500, true); - - // Get all these users, one at a time. - $rs = $DB->get_recordset_select('user_preferences', "name = 'calendar_lookahead' AND value != '0'"); - $i = 0; - foreach ($rs as $userpref) { - - // Calculate and set new lookahead value. - if ($userpref->value > 90) { - $newvalue = 120; - } else if ($userpref->value > 60 and $userpref->value < 90) { - $newvalue = 90; - } else if ($userpref->value > 30 and $userpref->value < 60) { - $newvalue = 60; - } else if ($userpref->value > 21 and $userpref->value < 30) { - $newvalue = 30; - } else if ($userpref->value > 14 and $userpref->value < 21) { - $newvalue = 21; - } else if ($userpref->value > 7 and $userpref->value < 14) { - $newvalue = 14; - } else { - $newvalue = $userpref->value; - } - - $DB->set_field('user_preferences', 'value', $newvalue, array('id' => $userpref->id)); - - // Update progress. - $i++; - $pbar->update($i, $total, "Upgrading user preference settings - $i/$total."); - } - $rs->close(); - $transaction->allow_commit(); - - upgrade_main_savepoint(true, 2016011901.00); - } - - if ($oldversion < 2016020200.00) { - - // Define field isstandard to be added to tag. - $table = new xmldb_table('tag'); - $field = new xmldb_field('isstandard', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'rawname'); - - // Conditionally launch add field isstandard. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Define index tagcolltype (not unique) to be dropped form tag. - // This index is no longer created however it was present at some point and it's better to be safe and try to drop it. - $index = new xmldb_index('tagcolltype', XMLDB_INDEX_NOTUNIQUE, array('tagcollid', 'tagtype')); - - // Conditionally launch drop index tagcolltype. - if ($dbman->index_exists($table, $index)) { - $dbman->drop_index($table, $index); - } - - // Define index tagcolltype (not unique) to be added to tag. - $index = new xmldb_index('tagcolltype', XMLDB_INDEX_NOTUNIQUE, array('tagcollid', 'isstandard')); - - // Conditionally launch add index tagcolltype. - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - // Define field tagtype to be dropped from tag. - $field = new xmldb_field('tagtype'); - - // Conditionally launch drop field tagtype and update isstandard. - if ($dbman->field_exists($table, $field)) { - $DB->execute("UPDATE {tag} SET isstandard=(CASE WHEN (tagtype = ?) THEN 1 ELSE 0 END)", array('official')); - $dbman->drop_field($table, $field); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016020200.00); - } - - if ($oldversion < 2016020201.00) { - - // Define field showstandard to be added to tag_area. - $table = new xmldb_table('tag_area'); - $field = new xmldb_field('showstandard', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'callbackfile'); - - // Conditionally launch add field showstandard. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // By default set user area to hide standard tags. 2 = core_tag_tag::HIDE_STANDARD (can not use constant here). - $DB->execute("UPDATE {tag_area} SET showstandard = ? WHERE itemtype = ? AND component = ?", - array(2, 'user', 'core')); - - // Changing precision of field enabled on table tag_area to (1). - $table = new xmldb_table('tag_area'); - $field = new xmldb_field('enabled', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1', 'itemtype'); - - // Launch change of precision for field enabled. - $dbman->change_field_precision($table, $field); - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016020201.00); - } - - if ($oldversion < 2016021500.00) { - $root = $CFG->tempdir . '/download'; - if (is_dir($root)) { - // Fetch each repository type - include all repos, not just enabled. - $repositories = $DB->get_records('repository', array(), '', 'type'); - - foreach ($repositories as $id => $repository) { - $directory = $root . '/repository_' . $repository->type; - if (is_dir($directory)) { - fulldelete($directory); - } - } - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016021500.00); - } - - if ($oldversion < 2016021501.00) { - // This could take a long time. Unfortunately, no way to know how long, and no way to do progress, so setting for 1 hour. - upgrade_set_timeout(3600); - - // Define index userid-itemid (not unique) to be added to grade_grades_history. - $table = new xmldb_table('grade_grades_history'); - $index = new xmldb_index('userid-itemid-timemodified', XMLDB_INDEX_NOTUNIQUE, array('userid', 'itemid', 'timemodified')); - - // Conditionally launch add index userid-itemid. - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016021501.00); - } - - if ($oldversion < 2016030103.00) { - - // MDL-50887. Implement plugins infrastructure for antivirus and create ClamAV plugin. - // This routine moves core ClamAV configuration to plugin level. - - // If clamav was configured and enabled, enable the plugin. - if (!empty($CFG->runclamonupload) && !empty($CFG->pathtoclam)) { - set_config('antiviruses', 'clamav'); - } else { - set_config('antiviruses', ''); - } - - if (isset($CFG->runclamonupload)) { - // Just unset global configuration, we have already enabled the plugin - // which implies that ClamAV will be used for scanning uploaded files. - unset_config('runclamonupload'); - } - // Move core ClamAV configuration settings to plugin. - if (isset($CFG->pathtoclam)) { - set_config('pathtoclam', $CFG->pathtoclam, 'antivirus_clamav'); - unset_config('pathtoclam'); - } - if (isset($CFG->quarantinedir)) { - set_config('quarantinedir', $CFG->quarantinedir, 'antivirus_clamav'); - unset_config('quarantinedir'); - } - if (isset($CFG->clamfailureonupload)) { - set_config('clamfailureonupload', $CFG->clamfailureonupload, 'antivirus_clamav'); - unset_config('clamfailureonupload'); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016030103.00); - } - - if ($oldversion < 2016030400.01) { - // Add the new services field. - $table = new xmldb_table('external_functions'); - $field = new xmldb_field('services', XMLDB_TYPE_CHAR, '1333', null, null, null, null, 'capabilities'); - - // Conditionally launch add field services. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - // Main savepoint reached. - upgrade_main_savepoint(true, 2016030400.01); - } - - if ($oldversion < 2016041500.50) { - - // Define table competency to be created. - $table = new xmldb_table('competency'); - - // Adding fields to table competency. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('shortname', XMLDB_TYPE_CHAR, '100', null, null, null, null); - $table->add_field('description', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('descriptionformat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('idnumber', XMLDB_TYPE_CHAR, '100', null, null, null, null); - $table->add_field('competencyframeworkid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('parentid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('path', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('ruletype', XMLDB_TYPE_CHAR, '100', null, null, null, null); - $table->add_field('ruleoutcome', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('ruleconfig', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('scaleid', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('scaleconfiguration', XMLDB_TYPE_TEXT, null, 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - - // Adding keys to table competency. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency. - $table->add_index('idnumberframework', XMLDB_INDEX_UNIQUE, array('competencyframeworkid', 'idnumber')); - $table->add_index('ruleoutcome', XMLDB_INDEX_NOTUNIQUE, array('ruleoutcome')); - - // Conditionally launch create table for competency. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.50); - } - - if ($oldversion < 2016041500.51) { - - // Define table competency_coursecompsetting to be created. - $table = new xmldb_table('competency_coursecompsetting'); - - // Adding fields to table competency_coursecompsetting. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('pushratingstouserplans', XMLDB_TYPE_INTEGER, '2', 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - - // Adding keys to table competency_coursecompsetting. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('courseidlink', XMLDB_KEY_FOREIGN_UNIQUE, array('courseid'), 'course', array('id')); - - // Conditionally launch create table for competency_coursecompsetting. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.51); - } - - if ($oldversion < 2016041500.52) { - - // Define table competency_framework to be created. - $table = new xmldb_table('competency_framework'); - - // Adding fields to table competency_framework. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('shortname', XMLDB_TYPE_CHAR, '100', null, null, null, null); - $table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('idnumber', XMLDB_TYPE_CHAR, '100', null, null, null, null); - $table->add_field('description', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('descriptionformat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('scaleid', XMLDB_TYPE_INTEGER, '11', null, null, null, null); - $table->add_field('scaleconfiguration', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null); - $table->add_field('visible', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '1'); - $table->add_field('taxonomies', XMLDB_TYPE_CHAR, '255', 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - - // Adding keys to table competency_framework. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_framework. - $table->add_index('idnumber', XMLDB_INDEX_UNIQUE, array('idnumber')); - - // Conditionally launch create table for competency_framework. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.52); - } - - if ($oldversion < 2016041500.53) { - - // Define table competency_coursecomp to be created. - $table = new xmldb_table('competency_coursecomp'); - - // Adding fields to table competency_coursecomp. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('competencyid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('ruleoutcome', XMLDB_TYPE_INTEGER, '2', 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_coursecomp. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('courseidlink', XMLDB_KEY_FOREIGN, array('courseid'), 'course', array('id')); - $table->add_key('competencyid', XMLDB_KEY_FOREIGN, array('competencyid'), 'competency_competency', array('id')); - - // Adding indexes to table competency_coursecomp. - $table->add_index('courseidruleoutcome', XMLDB_INDEX_NOTUNIQUE, array('courseid', 'ruleoutcome')); - $table->add_index('courseidcompetencyid', XMLDB_INDEX_UNIQUE, array('courseid', 'competencyid')); - - // Conditionally launch create table for competency_coursecomp. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.53); - } - - if ($oldversion < 2016041500.54) { - - // Define table competency_plan to be created. - $table = new xmldb_table('competency_plan'); - - // Adding fields to table competency_plan. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('name', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null); - $table->add_field('description', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('descriptionformat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('templateid', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('origtemplateid', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('status', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null); - $table->add_field('duedate', XMLDB_TYPE_INTEGER, '10', null, null, null, '0'); - $table->add_field('reviewerid', 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, '0'); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_plan. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_plan. - $table->add_index('useridstatus', XMLDB_INDEX_NOTUNIQUE, array('userid', 'status')); - $table->add_index('templateid', XMLDB_INDEX_NOTUNIQUE, array('templateid')); - $table->add_index('statusduedate', XMLDB_INDEX_NOTUNIQUE, array('status', 'duedate')); - - // Conditionally launch create table for competency_plan. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.54); - } - - if ($oldversion < 2016041500.55) { - - // Define table competency_template to be created. - $table = new xmldb_table('competency_template'); - - // Adding fields to table competency_template. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('shortname', XMLDB_TYPE_CHAR, '100', null, null, null, null); - $table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('description', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('descriptionformat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0'); - $table->add_field('visible', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '1'); - $table->add_field('duedate', 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - - // Adding keys to table competency_template. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Conditionally launch create table for competency_template. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.55); - } - - if ($oldversion < 2016041500.56) { - - // Define table competency_templatecomp to be created. - $table = new xmldb_table('competency_templatecomp'); - - // Adding fields to table competency_templatecomp. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('templateid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('competencyid', 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - - // Adding keys to table competency_templatecomp. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('templateidlink', XMLDB_KEY_FOREIGN, array('templateid'), 'competency_template', array('id')); - $table->add_key('competencyid', XMLDB_KEY_FOREIGN, array('competencyid'), 'competency_competency', array('id')); - - // Conditionally launch create table for competency_templatecomp. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.56); - } - - if ($oldversion < 2016041500.57) { - - // Define table competency_templatecohort to be created. - $table = new xmldb_table('competency_templatecohort'); - - // Adding fields to table competency_templatecohort. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('templateid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('cohortid', 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_templatecohort. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_templatecohort. - $table->add_index('templateid', XMLDB_INDEX_NOTUNIQUE, array('templateid')); - $table->add_index('templatecohortids', XMLDB_INDEX_UNIQUE, array('templateid', 'cohortid')); - - // Conditionally launch create table for competency_templatecohort. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.57); - } - - if ($oldversion < 2016041500.58) { - - // Define table competency_relatedcomp to be created. - $table = new xmldb_table('competency_relatedcomp'); - - // Adding fields to table competency_relatedcomp. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('competencyid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('relatedcompetencyid', 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, null, null, null); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_relatedcomp. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Conditionally launch create table for competency_relatedcomp. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.58); - } - - if ($oldversion < 2016041500.59) { - - // Define table competency_usercomp to be created. - $table = new xmldb_table('competency_usercomp'); - - // Adding fields to table competency_usercomp. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('competencyid', 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('reviewerid', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('proficiency', XMLDB_TYPE_INTEGER, '2', null, null, null, null); - $table->add_field('grade', 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, null, null, null); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_usercomp. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_usercomp. - $table->add_index('useridcompetency', XMLDB_INDEX_UNIQUE, array('userid', 'competencyid')); - - // Conditionally launch create table for competency_usercomp. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.59); - } - - if ($oldversion < 2016041500.60) { - - // Define table competency_usercompcourse to be created. - $table = new xmldb_table('competency_usercompcourse'); - - // Adding fields to table competency_usercompcourse. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('competencyid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('proficiency', XMLDB_TYPE_INTEGER, '2', null, null, null, null); - $table->add_field('grade', 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, null, null, null); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_usercompcourse. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_usercompcourse. - $table->add_index('useridcoursecomp', XMLDB_INDEX_UNIQUE, array('userid', 'courseid', 'competencyid')); - - // Conditionally launch create table for competency_usercompcourse. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.60); - } - - if ($oldversion < 2016041500.61) { - - // Define table competency_usercompplan to be created. - $table = new xmldb_table('competency_usercompplan'); - - // Adding fields to table competency_usercompplan. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('competencyid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('planid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('proficiency', XMLDB_TYPE_INTEGER, '2', null, null, null, null); - $table->add_field('grade', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('sortorder', 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, null, null, null); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_usercompplan. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_usercompplan. - $table->add_index('usercompetencyplan', XMLDB_INDEX_UNIQUE, array('userid', 'competencyid', 'planid')); - - // Conditionally launch create table for competency_usercompplan. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.61); - } - - if ($oldversion < 2016041500.62) { - - // Define table competency_plancomp to be created. - $table = new xmldb_table('competency_plancomp'); - - // Adding fields to table competency_plancomp. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('planid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('competencyid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('sortorder', 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, null, null, null); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_plancomp. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_plancomp. - $table->add_index('planidcompetencyid', XMLDB_INDEX_UNIQUE, array('planid', 'competencyid')); - - // Conditionally launch create table for competency_plancomp. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.62); - } - - if ($oldversion < 2016041500.63) { - - // Define table competency_evidence to be created. - $table = new xmldb_table('competency_evidence'); - - // Adding fields to table competency_evidence. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('usercompetencyid', 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('action', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, null); - $table->add_field('actionuserid', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('descidentifier', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('desccomponent', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('desca', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('url', XMLDB_TYPE_CHAR, '255', null, null, null, null); - $table->add_field('grade', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('note', XMLDB_TYPE_TEXT, null, 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_evidence. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_evidence. - $table->add_index('usercompetencyid', XMLDB_INDEX_NOTUNIQUE, array('usercompetencyid')); - - // Conditionally launch create table for competency_evidence. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.63); - } - - if ($oldversion < 2016041500.64) { - - // Define table competency_userevidence to be created. - $table = new xmldb_table('competency_userevidence'); - - // Adding fields to table competency_userevidence. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('name', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null); - $table->add_field('description', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null); - $table->add_field('descriptionformat', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null); - $table->add_field('url', XMLDB_TYPE_TEXT, null, 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_userevidence. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_userevidence. - $table->add_index('userid', XMLDB_INDEX_NOTUNIQUE, array('userid')); - - // Conditionally launch create table for competency_userevidence. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.64); - } - - if ($oldversion < 2016041500.65) { - - // Define table competency_userevidencecomp to be created. - $table = new xmldb_table('competency_userevidencecomp'); - - // Adding fields to table competency_userevidencecomp. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('userevidenceid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('competencyid', 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_userevidencecomp. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Adding indexes to table competency_userevidencecomp. - $table->add_index('userevidenceid', XMLDB_INDEX_NOTUNIQUE, array('userevidenceid')); - $table->add_index('userevidencecompids', XMLDB_INDEX_UNIQUE, array('userevidenceid', 'competencyid')); - - // Conditionally launch create table for competency_userevidencecomp. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.65); - } - - if ($oldversion < 2016041500.66) { - - // Define table competency_modulecomp to be created. - $table = new xmldb_table('competency_modulecomp'); - - // Adding fields to table competency_modulecomp. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('cmid', 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); - $table->add_field('usermodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('competencyid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('ruleoutcome', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table competency_modulecomp. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('cmidkey', XMLDB_KEY_FOREIGN, array('cmid'), 'course_modules', array('id')); - $table->add_key('competencyidkey', XMLDB_KEY_FOREIGN, array('competencyid'), 'competency_competency', array('id')); - - // Adding indexes to table competency_modulecomp. - $table->add_index('cmidruleoutcome', XMLDB_INDEX_NOTUNIQUE, array('cmid', 'ruleoutcome')); - $table->add_index('cmidcompetencyid', XMLDB_INDEX_UNIQUE, array('cmid', 'competencyid')); - - // Conditionally launch create table for competency_modulecomp. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Main savepoint reached. - upgrade_main_savepoint(true, 2016041500.66); - } - - if ($oldversion < 2016042100.00) { - // Update all countries to upper case. - $DB->execute("UPDATE {user} SET country = UPPER(country)"); - // Main savepoint reached. - upgrade_main_savepoint(true, 2016042100.00); - } - - if ($oldversion < 2016042600.01) { - $deprecatedwebservices = [ - 'moodle_course_create_courses', - 'moodle_course_get_courses', - 'moodle_enrol_get_enrolled_users', - 'moodle_enrol_get_users_courses', - 'moodle_enrol_manual_enrol_users', - 'moodle_file_get_files', - 'moodle_file_upload', - 'moodle_group_add_groupmembers', - 'moodle_group_create_groups', - 'moodle_group_delete_groupmembers', - 'moodle_group_delete_groups', - 'moodle_group_get_course_groups', - 'moodle_group_get_groupmembers', - 'moodle_group_get_groups', - 'moodle_message_send_instantmessages', - 'moodle_notes_create_notes', - 'moodle_role_assign', - 'moodle_role_unassign', - 'moodle_user_create_users', - 'moodle_user_delete_users', - 'moodle_user_get_course_participants_by_id', - 'moodle_user_get_users_by_courseid', - 'moodle_user_get_users_by_id', - 'moodle_user_update_users', - 'core_grade_get_definitions', - 'core_user_get_users_by_id', - 'moodle_webservice_get_siteinfo', - 'mod_forum_get_forum_discussions' - ]; - - list($insql, $params) = $DB->get_in_or_equal($deprecatedwebservices); - $DB->delete_records_select('external_functions', "name $insql", $params); - $DB->delete_records_select('external_services_functions', "functionname $insql", $params); - // Main savepoint reached. - upgrade_main_savepoint(true, 2016042600.01); - } - - if ($oldversion < 2016051300.00) { - // Add a default competency rating scale. - make_competence_scale(); - - // Savepoint reached. - upgrade_main_savepoint(true, 2016051300.00); - } - - if ($oldversion < 2016051700.01) { - // This script is included in each major version upgrade process (3.0, 3.1) so make sure we don't run it twice. - if (empty($CFG->upgrade_letterboundarycourses)) { - // MDL-45390. If a grade is being displayed with letters and the grade boundaries are not being adhered to properly - // then this course will also be frozen. - // If the changes are accepted then the display of some grades may change. - // This is here to freeze the gradebook in affected courses. - upgrade_course_letter_boundary(); - - // To skip running the same script on the upgrade to the next major version release. - set_config('upgrade_letterboundarycourses', 1); - } - // Main savepoint reached. - upgrade_main_savepoint(true, 2016051700.01); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016081700.00) { // If someone is emotionally attached to it let's leave the config (basically the version) there. diff --git a/lib/editor/atto/db/upgrade.php b/lib/editor/atto/db/upgrade.php index 4483e412412dc..283a09f6e96b9 100644 --- a/lib/editor/atto/db/upgrade.php +++ b/lib/editor/atto/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_editor_atto_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 dcab5bb34f77e..efe6f10f2b5e4 100644 --- a/lib/editor/atto/plugins/equation/db/upgrade.php +++ b/lib/editor/atto/plugins/equation/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_atto_equation_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 9e3b709cdca4c..6f8f80f6f77b2 100644 --- a/lib/editor/tinymce/db/upgrade.php +++ b/lib/editor/tinymce/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_editor_tinymce_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 2cf7efe6c592e..a56ffb465d410 100644 --- a/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php +++ b/lib/editor/tinymce/plugins/spellchecker/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_tinymce_spellchecker_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 79b3fa9102590..cf94659168f47 100644 --- a/message/output/email/db/upgrade.php +++ b/message/output/email/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_message_email_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 6db361a108380..616e44d280751 100644 --- a/message/output/jabber/db/upgrade.php +++ b/message/output/jabber/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_message_jabber_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 c82679c74fb2c..455d89a4d78a7 100644 --- a/message/output/popup/db/upgrade.php +++ b/message/output/popup/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_message_popup_upgrade($oldversion) { global $CFG, $DB; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - $dbman = $DB->get_manager(); if ($oldversion < 2016052309) { diff --git a/mod/assign/db/upgrade.php b/mod/assign/db/upgrade.php index fe87115460b88..013eaa0f133af 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(); - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016100301) { // Define table assign_overrides to be created. diff --git a/mod/assign/feedback/comments/db/upgrade.php b/mod/assign/feedback/comments/db/upgrade.php index 859ac0e071169..0288554cda572 100644 --- a/mod/assign/feedback/comments/db/upgrade.php +++ b/mod/assign/feedback/comments/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_assignfeedback_comments_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 19882e3cd63a3..18d5c3b6429af 100644 --- a/mod/assign/feedback/editpdf/db/upgrade.php +++ b/mod/assign/feedback/editpdf/db/upgrade.php @@ -34,31 +34,6 @@ function xmldb_assignfeedback_editpdf_upgrade($oldversion) { $dbman = $DB->get_manager(); - if ($oldversion < 2016021600) { - - // Define table assignfeedback_editpdf_queue to be created. - $table = new xmldb_table('assignfeedback_editpdf_queue'); - - // Adding fields to table assignfeedback_editpdf_queue. - $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('submissionid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - $table->add_field('submissionattempt', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); - - // Adding keys to table assignfeedback_editpdf_queue. - $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - - // Conditionally launch create table for assignfeedback_editpdf_queue. - if (!$dbman->table_exists($table)) { - $dbman->create_table($table); - } - - // Editpdf savepoint reached. - upgrade_plugin_savepoint(true, 2016021600, 'assignfeedback', 'editpdf'); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 adfc975fc0ff8..81c791fc3a3f8 100644 --- a/mod/assign/feedback/file/db/upgrade.php +++ b/mod/assign/feedback/file/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_assignfeedback_file_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 7cd110e1054ca..46dafbe2a1348 100644 --- a/mod/assign/submission/comments/db/upgrade.php +++ b/mod/assign/submission/comments/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_assignsubmission_comments_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 a2c9c1b002d12..69b2dbb434754 100644 --- a/mod/assign/submission/file/db/upgrade.php +++ b/mod/assign/submission/file/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_assignsubmission_file_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 f4a6c79e5a129..4fddf2d9f8854 100644 --- a/mod/assign/submission/onlinetext/db/upgrade.php +++ b/mod/assign/submission/onlinetext/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_assignsubmission_onlinetext_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 e508cf6b1d281..0e633a5afcffb 100644 --- a/mod/assignment/db/upgrade.php +++ b/mod/assignment/db/upgrade.php @@ -24,9 +24,6 @@ function xmldb_assignment_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 e54b01a43c707..6437d3e1e1709 100644 --- a/mod/book/db/upgrade.php +++ b/mod/book/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_book_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 d40fd755bc392..d27ca3e0f339c 100644 --- a/mod/chat/db/upgrade.php +++ b/mod/chat/db/upgrade.php @@ -27,9 +27,6 @@ function xmldb_chat_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 7ea378786e1e2..82136fba62286 100644 --- a/mod/choice/db/upgrade.php +++ b/mod/choice/db/upgrade.php @@ -24,9 +24,6 @@ function xmldb_choice_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 2e94c9565c594..7287381269bbb 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -26,25 +26,6 @@ function xmldb_data_upgrade($oldversion) { $dbman = $DB->get_manager(); - if ($oldversion < 2016030300) { - - // Define field timemodified to be added to data. - $table = new xmldb_table('data'); - $field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'notification'); - - // Conditionally launch add field timemodified. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Data savepoint reached. - upgrade_mod_savepoint(true, 2016030300, 'data'); - } - - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016090600) { // Define field config to be added to data. diff --git a/mod/feedback/db/upgrade.php b/mod/feedback/db/upgrade.php index d69f88eabbfe0..66873554268e6 100644 --- a/mod/feedback/db/upgrade.php +++ b/mod/feedback/db/upgrade.php @@ -42,101 +42,6 @@ function xmldb_feedback_upgrade($oldversion) { $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. - if ($oldversion < 2016031600) { - // Remove labels from all 'captcha' and 'label' items. - $DB->execute('UPDATE {feedback_item} SET label = ? WHERE typ = ? OR typ = ?', - array('', 'captcha', 'label')); - - // Data savepoint reached. - upgrade_mod_savepoint(true, 2016031600, 'feedback'); - } - - if ($oldversion < 2016040100) { - - // In order to keep the previous "Analysis" results unchanged, - // set all multiple-answer multiplechoice questions as "Do not analyse empty submits"="Yes" - // because prior to this date this setting did not work. - - $sql = "UPDATE {feedback_item} SET options = " . $DB->sql_concat('?', 'options') . - " WHERE typ = ? AND presentation LIKE ? AND options NOT LIKE ?"; - $params = array('i', 'multichoice', 'c%', '%i%'); - $DB->execute($sql, $params); - - // Feedback savepoint reached. - upgrade_mod_savepoint(true, 2016040100, 'feedback'); - } - - if ($oldversion < 2016051103) { - - // Define index completed_item (unique) to be added to feedback_value. - $table = new xmldb_table('feedback_value'); - $index = new xmldb_index('completed_item', XMLDB_INDEX_UNIQUE, array('completed', 'item', 'course_id')); - - // Conditionally launch add index completed_item. - if (!$dbman->index_exists($table, $index)) { - mod_feedback_upgrade_delete_duplicate_values(); - $dbman->add_index($table, $index); - } - - // Feedback savepoint reached. - upgrade_mod_savepoint(true, 2016051103, 'feedback'); - } - - if ($oldversion < 2016051104) { - - // Define index completed_item (unique) to be added to feedback_valuetmp. - $table = new xmldb_table('feedback_valuetmp'); - $index = new xmldb_index('completed_item', XMLDB_INDEX_UNIQUE, array('completed', 'item', 'course_id')); - - // Conditionally launch add index completed_item. - if (!$dbman->index_exists($table, $index)) { - mod_feedback_upgrade_delete_duplicate_values(true); - $dbman->add_index($table, $index); - } - - // Feedback savepoint reached. - upgrade_mod_savepoint(true, 2016051104, 'feedback'); - } - - if ($oldversion < 2016051105) { - - // Define field courseid to be added to feedback_completed. - $table = new xmldb_table('feedback_completed'); - $field = new xmldb_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'anonymous_response'); - - // Conditionally launch add field courseid. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - // Run upgrade script to fill the new field courseid with the data from feedback_value table. - mod_feedback_upgrade_courseid(false); - } - - // Define field courseid to be added to feedback_completedtmp. - $table = new xmldb_table('feedback_completedtmp'); - $field = new xmldb_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'anonymous_response'); - - // Conditionally launch add field courseid. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - // Run upgrade script to fill the new field courseid with the data from feedback_valuetmp table. - mod_feedback_upgrade_courseid(true); - } - - // Define table feedback_tracking to be dropped. - $table = new xmldb_table('feedback_tracking'); - - // Conditionally launch drop table for feedback_tracking. - if ($dbman->table_exists($table)) { - $dbman->drop_table($table); - } - - // Feedback savepoint reached. - upgrade_mod_savepoint(true, 2016051105, 'feedback'); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 927858b904947..aca1bb1d4e8f4 100644 --- a/mod/folder/db/upgrade.php +++ b/mod/folder/db/upgrade.php @@ -49,20 +49,6 @@ function xmldb_folder_upgrade($oldversion) { $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. - // Add showdownloadfolder option. - if ($oldversion < 2016020201) { - $table = new xmldb_table('folder'); - $field = new xmldb_field('showdownloadfolder', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1', 'showexpanded'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field, 'showdownloadfolder'); - } - - upgrade_mod_savepoint(true, 2016020201, 'folder'); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 49be5b19e12e3..f523a38035069 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -47,22 +47,6 @@ function xmldb_forum_upgrade($oldversion) { $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. - if ($oldversion < 2015120800) { - - // Add support for pinned discussions. - $table = new xmldb_table('forum_discussions'); - $field = new xmldb_field('pinned', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'timeend'); - - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Forum savepoint reached. - upgrade_mod_savepoint(true, 2015120800, 'forum'); - } - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016091200) { // Define field lockdiscussionafter to be added to forum. diff --git a/mod/glossary/db/upgrade.php b/mod/glossary/db/upgrade.php index 5272f6f1124bf..a4a055a2bb06f 100644 --- a/mod/glossary/db/upgrade.php +++ b/mod/glossary/db/upgrade.php @@ -22,9 +22,6 @@ function xmldb_glossary_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 be0613c0f2584..ff169ec74dcc0 100644 --- a/mod/imscp/db/upgrade.php +++ b/mod/imscp/db/upgrade.php @@ -31,9 +31,6 @@ function xmldb_imscp_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 2106625c2497a..cb877fee0f932 100644 --- a/mod/label/db/upgrade.php +++ b/mod/label/db/upgrade.php @@ -47,9 +47,6 @@ function xmldb_label_upgrade($oldversion) { global $CFG, $DB; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 b70c9c47943cc..8ab0f027b054e 100644 --- a/mod/lesson/db/upgrade.php +++ b/mod/lesson/db/upgrade.php @@ -54,64 +54,6 @@ function xmldb_lesson_upgrade($oldversion) { $dbman = $DB->get_manager(); - if ($oldversion < 2016012800) { - // Convert lesson settings to use config_plugins instead of $CFG. - // Lesson_maxanswers => mod_lesson/maxanswers. - if (isset($CFG->lesson_maxanswers)) { - set_config('maxanswers', $CFG->lesson_maxanswers, 'mod_lesson'); - set_config('maxanswers_adv', '1', 'mod_lesson'); - unset_config('lesson_maxanswers'); - } - - // Lesson_slideshowwidth => mod_lesson/slideshowwidth. - if (isset($CFG->lesson_slideshowwidth)) { - set_config('slideshowwidth', $CFG->lesson_slideshowwidth, 'mod_lesson'); - unset_config('lesson_slideshowwidth'); - } - - // Lesson_slideshowheight => mod_lesson/slideshowheight. - if (isset($CFG->lesson_slideshowheight)) { - set_config('slideshowheight', $CFG->lesson_slideshowheight, 'mod_lesson'); - unset_config('lesson_slideshowheight'); - } - - // Lesson_slideshowbgcolor => mod_lesson/slideshowbgcolor. - if (isset($CFG->lesson_slideshowbgcolor)) { - set_config('slideshowbgcolor', $CFG->lesson_slideshowbgcolor, 'mod_lesson'); - unset_config('lesson_slideshowbgcolor'); - } - - // Lesson_defaultnextpage => mod_lesson/defaultnextpage. - if (isset($CFG->lesson_defaultnextpage)) { - set_config('defaultnextpage', $CFG->lesson_defaultnextpage, 'mod_lesson'); - set_config('defaultnextpage_adv', '1', 'mod_lesson'); - unset_config('lesson_defaultnextpage'); - } - - // Lesson_mediawidth => mod_lesson/mediawidth. - if (isset($CFG->lesson_mediawidth)) { - set_config('mediawidth', $CFG->lesson_mediawidth, 'mod_lesson'); - unset_config('lesson_mediawidth'); - } - - // Lesson_mediaheight => mod_lesson/mediaheight. - if (isset($CFG->lesson_mediaheight)) { - set_config('mediaheight', $CFG->lesson_mediaheight, 'mod_lesson'); - unset_config('lesson_mediaheight'); - } - - // Lesson_mediaclose => mod_lesson/mediaclose. - if (isset($CFG->lesson_mediaclose)) { - set_config('mediaclose', $CFG->lesson_mediaclose, 'mod_lesson'); - unset_config('lesson_mediaclose'); - } - - // Lesson savepoint reached. - upgrade_mod_savepoint(true, 2016012800, 'lesson'); - } - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 9f7bd5ff9ac33..b50277a7d8bf1 100644 --- a/mod/lti/db/upgrade.php +++ b/mod/lti/db/upgrade.php @@ -63,24 +63,6 @@ function xmldb_lti_upgrade($oldversion) { $dbman = $DB->get_manager(); - if ($oldversion < 2016041800) { - - // Define field description to be added to lti_types. - $table = new xmldb_table('lti_types'); - $field = new xmldb_field('description', XMLDB_TYPE_TEXT, null, null, null, null, null, 'timemodified'); - - // Conditionally launch add field description. - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Lti savepoint reached. - upgrade_mod_savepoint(true, 2016041800, 'lti'); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016052301) { // Changing type of field value on table lti_types_config to text. diff --git a/mod/page/db/upgrade.php b/mod/page/db/upgrade.php index afbd6bc1b4929..67a0154a2d600 100644 --- a/mod/page/db/upgrade.php +++ b/mod/page/db/upgrade.php @@ -47,9 +47,6 @@ function xmldb_page_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 97c2af9575465..728e07504faa1 100644 --- a/mod/quiz/db/upgrade.php +++ b/mod/quiz/db/upgrade.php @@ -33,34 +33,6 @@ function xmldb_quiz_upgrade($oldversion) { $dbman = $DB->get_manager(); - if ($oldversion < 2016032600) { - // Update quiz_sections to repair quizzes what were broken by MDL-53507. - $problemquizzes = $DB->get_records_sql(" - SELECT quizid, MIN(firstslot) AS firstsectionfirstslot - FROM {quiz_sections} - GROUP BY quizid - HAVING MIN(firstslot) > 1"); - - if ($problemquizzes) { - $pbar = new progress_bar('upgradequizfirstsection', 500, true); - $total = count($problemquizzes); - $done = 0; - foreach ($problemquizzes as $problemquiz) { - $DB->set_field('quiz_sections', 'firstslot', 1, - array('quizid' => $problemquiz->quizid, - 'firstslot' => $problemquiz->firstsectionfirstslot)); - $done += 1; - $pbar->update($done, $total, "Fixing quiz layouts - {$done}/{$total}."); - } - } - - // Quiz savepoint reached. - upgrade_mod_savepoint(true, 2016032600, 'quiz'); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016092000) { // Define new fields to be added to quiz. $table = new xmldb_table('quiz'); diff --git a/mod/quiz/report/overview/db/upgrade.php b/mod/quiz/report/overview/db/upgrade.php index 95b9259a1d14b..0ea300de46b60 100644 --- a/mod/quiz/report/overview/db/upgrade.php +++ b/mod/quiz/report/overview/db/upgrade.php @@ -31,9 +31,6 @@ function xmldb_quiz_overview_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 6b8895a4b8259..147f379c88d67 100644 --- a/mod/quiz/report/statistics/db/upgrade.php +++ b/mod/quiz/report/statistics/db/upgrade.php @@ -30,9 +30,6 @@ function xmldb_quiz_statistics_upgrade($oldversion) { global $DB; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016100500) { // Clear the quiz_statistics table - it is only a cache table anyway. // This will force re-calculation. diff --git a/mod/resource/db/upgrade.php b/mod/resource/db/upgrade.php index 075cf16247295..a662488d6fb2a 100644 --- a/mod/resource/db/upgrade.php +++ b/mod/resource/db/upgrade.php @@ -47,9 +47,6 @@ function xmldb_resource_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 5b061add0cb0e..d8141b09781a9 100644 --- a/mod/scorm/db/upgrade.php +++ b/mod/scorm/db/upgrade.php @@ -34,21 +34,6 @@ function xmldb_scorm_upgrade($oldversion) { $dbman = $DB->get_manager(); - // MDL-50620 Add mastery override option. - if ($oldversion < 2016021000) { - $table = new xmldb_table('scorm'); - - $field = new xmldb_field('masteryoverride', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1', 'lastattemptlock'); - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - upgrade_mod_savepoint(true, 2016021000, 'scorm'); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // MDL-44712 improve multi-sco activity completion. if ($oldversion < 2016080900) { $table = new xmldb_table('scorm'); diff --git a/mod/survey/db/upgrade.php b/mod/survey/db/upgrade.php index e843849405cc6..347d90fb06da8 100644 --- a/mod/survey/db/upgrade.php +++ b/mod/survey/db/upgrade.php @@ -23,10 +23,9 @@ function xmldb_survey_upgrade($oldversion) { global $DB; + $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes. - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. if ($oldversion < 2016061400) { // Define field completionsubmit to be added to survey. diff --git a/mod/url/db/upgrade.php b/mod/url/db/upgrade.php index d965d5b8d822f..26ab43ddda544 100644 --- a/mod/url/db/upgrade.php +++ b/mod/url/db/upgrade.php @@ -47,9 +47,6 @@ function xmldb_url_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 a476c13122ad2..8537f2a9e7e30 100644 --- a/mod/wiki/db/upgrade.php +++ b/mod/wiki/db/upgrade.php @@ -40,9 +40,6 @@ function xmldb_wiki_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 c5fd44e070d02..22712e16fadc4 100644 --- a/mod/workshop/db/upgrade.php +++ b/mod/workshop/db/upgrade.php @@ -39,29 +39,6 @@ function xmldb_workshop_upgrade($oldversion) { $dbman = $DB->get_manager(); - if ($oldversion < 2016022200) { - // Add field submissionfiletypes to the table workshop. - $table = new xmldb_table('workshop'); - $field = new xmldb_field('submissionfiletypes', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'nattachments'); - - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - // Add field overallfeedbackfiletypes to the table workshop. - $field = new xmldb_field('overallfeedbackfiletypes', - XMLDB_TYPE_CHAR, '255', null, null, null, null, 'overallfeedbackfiles'); - - if (!$dbman->field_exists($table, $field)) { - $dbman->add_field($table, $field); - } - - upgrade_mod_savepoint(true, 2016022200, 'workshop'); - } - - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 f2ea25b4d08f1..7aa5f184fded3 100644 --- a/mod/workshop/form/accumulative/db/upgrade.php +++ b/mod/workshop/form/accumulative/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_workshopform_accumulative_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 cda03ccd92d90..ed177800c83df 100644 --- a/mod/workshop/form/comments/db/upgrade.php +++ b/mod/workshop/form/comments/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_workshopform_comments_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 c3328c78e4869..8bbaa8ceb5f5c 100644 --- a/mod/workshop/form/numerrors/db/upgrade.php +++ b/mod/workshop/form/numerrors/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_workshopform_numerrors_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 edc51c8698b08..a342df14c63a3 100644 --- a/mod/workshop/form/rubric/db/upgrade.php +++ b/mod/workshop/form/rubric/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_workshopform_rubric_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 85873d80f1658..fbb1c339aa93d 100644 --- a/portfolio/boxnet/db/upgrade.php +++ b/portfolio/boxnet/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_portfolio_boxnet_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 081fbf0eed963..807eb41899aae 100644 --- a/portfolio/googledocs/db/upgrade.php +++ b/portfolio/googledocs/db/upgrade.php @@ -23,9 +23,6 @@ function xmldb_portfolio_googledocs_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 973e52b73a67d..1f58cca44a1d9 100644 --- a/portfolio/picasa/db/upgrade.php +++ b/portfolio/picasa/db/upgrade.php @@ -23,9 +23,6 @@ function xmldb_portfolio_picasa_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 882eaf8c36472..aa14c01d57087 100644 --- a/question/behaviour/manualgraded/db/upgrade.php +++ b/question/behaviour/manualgraded/db/upgrade.php @@ -30,9 +30,6 @@ function xmldb_qbehaviour_manualgraded_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 366a9b72c042f..ca315ac62b954 100644 --- a/question/type/calculated/db/upgrade.php +++ b/question/type/calculated/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_qtype_calculated_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 2561141e2c6ae..aeae12fdec285 100644 --- a/question/type/ddmarker/db/upgrade.php +++ b/question/type/ddmarker/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_qtype_ddmarker_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 893d71be58299..ec0726792d291 100644 --- a/question/type/essay/db/upgrade.php +++ b/question/type/essay/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_qtype_essay_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/match/db/upgrade.php b/question/type/match/db/upgrade.php index 5374e6ea58ecf..3f10940f7cd44 100644 --- a/question/type/match/db/upgrade.php +++ b/question/type/match/db/upgrade.php @@ -31,9 +31,6 @@ function xmldb_qtype_match_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 79ae898a50ed8..87c7b04ecefe1 100644 --- a/question/type/multianswer/db/upgrade.php +++ b/question/type/multianswer/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_qtype_multianswer_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 86c2070e5c8db..a60e40bc355c4 100644 --- a/question/type/multichoice/db/upgrade.php +++ b/question/type/multichoice/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_qtype_multichoice_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.0 release upgrade line. // Put any upgrade step following this. diff --git a/question/type/numerical/db/upgrade.php b/question/type/numerical/db/upgrade.php index a2a00e5b916d1..44947eaf5a04c 100644 --- a/question/type/numerical/db/upgrade.php +++ b/question/type/numerical/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_qtype_numerical_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 82fa64fb6fec2..a6e32fcc1bb5e 100644 --- a/question/type/random/db/upgrade.php +++ b/question/type/random/db/upgrade.php @@ -31,9 +31,6 @@ function xmldb_qtype_random_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 c46373acf57a6..43582527a9356 100644 --- a/question/type/randomsamatch/db/upgrade.php +++ b/question/type/randomsamatch/db/upgrade.php @@ -31,9 +31,6 @@ function xmldb_qtype_randomsamatch_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 da65861a91c7c..3823dae74a4f3 100644 --- a/question/type/shortanswer/db/upgrade.php +++ b/question/type/shortanswer/db/upgrade.php @@ -32,9 +32,6 @@ function xmldb_qtype_shortanswer_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 f6ab981e9aa74..4d2e451273e52 100644 --- a/repository/boxnet/db/upgrade.php +++ b/repository/boxnet/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_repository_boxnet_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 9032de3c86b11..c03d407def007 100644 --- a/repository/dropbox/db/upgrade.php +++ b/repository/dropbox/db/upgrade.php @@ -23,9 +23,6 @@ function xmldb_repository_dropbox_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - if ($oldversion < 2016091300) { unset_config('legacyapi', 'dropbox'); upgrade_plugin_savepoint(true, 2016091300, 'repository', 'dropbox'); diff --git a/repository/googledocs/db/upgrade.php b/repository/googledocs/db/upgrade.php index 61827a88ae477..6d8ca5ecedc31 100644 --- a/repository/googledocs/db/upgrade.php +++ b/repository/googledocs/db/upgrade.php @@ -23,9 +23,6 @@ function xmldb_repository_googledocs_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.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 572c6e7bf73bb..668db4c8c3b8e 100644 --- a/repository/picasa/db/upgrade.php +++ b/repository/picasa/db/upgrade.php @@ -23,9 +23,6 @@ function xmldb_repository_picasa_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.0 release upgrade line. // Put any upgrade step following this. diff --git a/theme/more/db/upgrade.php b/theme/more/db/upgrade.php index 692a660b2112c..480e5e97f9163 100644 --- a/theme/more/db/upgrade.php +++ b/theme/more/db/upgrade.php @@ -33,9 +33,6 @@ function xmldb_theme_more_upgrade($oldversion) { global $CFG; - // Moodle v3.1.0 release upgrade line. - // Put any upgrade step following this. - // Automatically generated Moodle v3.2.0 release upgrade line. // Put any upgrade step following this.