Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #123: Fix schema issues in report_customsql_categories #1

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,5 +269,21 @@ function xmldb_report_customsql_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2021111600, 'report', 'customsql');
}

if ($oldversion < 2022031801) {

// Changing nullability of field name on table report_customsql_categories to not null.
// Changing the default of field name on table report_customsql_categories to drop it.
$table = new xmldb_table('report_customsql_categories');
$field = new xmldb_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'id');

// Launch change of nullability for field name.
$dbman->change_field_notnull($table, $field);
// Launch change of default for field name.
$dbman->change_field_default($table, $field);

// Report savepoint reached.
upgrade_plugin_savepoint(true, 2022031801, 'report', 'customsql');
}

return true;
}
2 changes: 1 addition & 1 deletion tests/local/category_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class _category_test extends \advanced_testcase {
class category_test extends \advanced_testcase {
/**
* Test create category.
*/
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2022031800;
$plugin->version = 2022031801;
$plugin->requires = 2020061500;
$plugin->component = 'report_customsql';
$plugin->maturity = MATURITY_STABLE;
Expand Down