Skip to content

Commit

Permalink
user upgrade in db and version
Browse files Browse the repository at this point in the history
  • Loading branch information
yedidiaklein committed Jun 4, 2023
1 parent 6ed664c commit c7d9284
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,15 @@ function xmldb_local_aiquestions_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2023050501, 'local', 'aiquestions');
}

if ($oldversion < 2023053000) {
// Rename user field to userid.
$table = new xmldb_table('local_aiquestions');
$field = new xmldb_field('user', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'course');
if ($dbman->field_exists($table, $field)) {
$dbman->rename_field($table, $field, 'userid');
}
upgrade_plugin_savepoint(true, 2023053000, 'local', 'aiquestions');
}

return true;
}
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'local_aiquestions';
$plugin->release = '0.9.6';
$plugin->version = 2023051400;
$plugin->release = '0.9.7';
$plugin->version = 2023060400;
$plugin->requires = 2022041900;
$plugin->maturity = MATURITY_RC;

0 comments on commit c7d9284

Please sign in to comment.