From 264c4817d4b5b9aade121595f5069c969b0448dc Mon Sep 17 00:00:00 2001 From: Mikhail Golenkov Date: Thu, 30 Jul 2020 12:45:52 +1000 Subject: [PATCH] Set correct default value for showrecent column. --- db/upgrade.php | 11 +++++++++++ version.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/db/upgrade.php b/db/upgrade.php index 937f5d43..60e2b356 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -343,6 +343,17 @@ function xmldb_hsuforum_upgrade($oldversion) { upgrade_mod_savepoint(true, 2018120301, 'hsuforum'); } + if ($oldversion < 2020073000) { + // Set correct default value for showrecent column. + $table = new xmldb_table('hsuforum'); + $field = new xmldb_field('showrecent', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1', 'displaywordcount'); + if ($dbman->field_exists($table, $field)) { + $dbman->change_field_default($table, $field); + } + // Open Forum savepoint reached. + upgrade_mod_savepoint(true, 2020073000, 'hsuforum'); + } + return true; } diff --git a/version.php b/version.php index 4a1ba0e0..15107ade 100644 --- a/version.php +++ b/version.php @@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2018120301; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2020073000; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2019052000; // Requires this Moodle version $plugin->component = 'mod_hsuforum'; // Full name of the plugin (used for diagnostics). $plugin->release = '3.7.3';