Skip to content
Snippets Groups Projects
Commit 80651ebb authored by Chris Sangwin's avatar Chris Sangwin
Browse files

Fix mismatch in upgrade order.

parent 465ff603
Branches
Tags
No related merge requests found
......@@ -865,31 +865,6 @@ function xmldb_qtype_stack_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2021010100, 'qtype', 'stack');
}
if ($oldversion < 2023042200) {
// Define field description to be added to qtype_stack_prt_nodes.
$table = new xmldb_table('qtype_stack_prt_nodes');
$field = new xmldb_field('description', XMLDB_TYPE_CHAR, '255', null, null, null, '', 'nodename');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Define question description field to be added to qtype_stack_options.
$table = new xmldb_table('qtype_stack_options');
$field = new xmldb_field('questiondescription', XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'questionnote');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
$field = new xmldb_field('questiondescriptionformat', XMLDB_TYPE_INTEGER,
'2', null, XMLDB_NOTNULL, null, '0', 'questiondescription');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Stack savepoint reached.
upgrade_plugin_savepoint(true, 2023042200, 'qtype', 'stack');
}
if ($oldversion < 2022042700) {
// Changing type of field truescore on table qtype_stack_prt_nodes to char.
$table = new xmldb_table('qtype_stack_prt_nodes');
......@@ -923,6 +898,31 @@ function xmldb_qtype_stack_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2022042700, 'qtype', 'stack');
}
if ($oldversion < 2023042200) {
// Define field description to be added to qtype_stack_prt_nodes.
$table = new xmldb_table('qtype_stack_prt_nodes');
$field = new xmldb_field('description', XMLDB_TYPE_CHAR, '255', null, null, null, '', 'nodename');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Define question description field to be added to qtype_stack_options.
$table = new xmldb_table('qtype_stack_options');
$field = new xmldb_field('questiondescription', XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'questionnote');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
$field = new xmldb_field('questiondescriptionformat', XMLDB_TYPE_INTEGER,
'2', null, XMLDB_NOTNULL, null, '0', 'questiondescription');
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Stack savepoint reached.
upgrade_plugin_savepoint(true, 2023042200, 'qtype', 'stack');
}
if ($oldversion < 2023042800) {
// Define field description to be added to qtype_stack_qtests.
$table = new xmldb_table('qtype_stack_qtests');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment