From 80b6fb422d37f79191d5d998da0896c4507ee4e0 Mon Sep 17 00:00:00 2001 From: bdaloukas Date: Fri, 16 Jun 2017 07:07:30 +0300 Subject: [PATCH] Change name of game_cross.rows to usedrows (MariaDB compatibility) --- db/upgrade.php | 12 ++++++++---- version.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/db/upgrade.php b/db/upgrade.php index bea7a9d..e7d0d22 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -1556,10 +1556,12 @@ function xmldb_game_upgrade($oldversion) { $dbman->change_field_type($table, $field); } - if ($oldversion < ($ver = 2017061603)) { + if ($oldversion < ($ver = 2017061604)) { $table = new xmldb_table('game_cross'); $field = new xmldb_field('usedcols', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); - $dbman->add_field($table, $field); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } $field = new xmldb_field('cols', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); if ($dbman->field_exists($table, $field)) { @@ -1571,10 +1573,12 @@ function xmldb_game_upgrade($oldversion) { } } - if ($oldversion < ($ver = 2017061603)) { + if ($oldversion < ($ver = 2017061604)) { $table = new xmldb_table('game_cross'); $field = new xmldb_field('usedrows', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); - $dbman->add_field($table, $field); + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } $field = new xmldb_field('rows', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); if ($dbman->field_exists($table, $field)) { diff --git a/version.php b/version.php index 57ba01a..3b240bc 100644 --- a/version.php +++ b/version.php @@ -35,7 +35,7 @@ if (!isset( $plugin)) { } $plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics). -$plugin->version = 2017061603; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2017061604; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2010112400; // Requires Moodle 2.0. $plugin->cron = 0; // Period for cron to check this module (secs). $plugin->release = '2017-06-13';