Problem in database schema after upgrading Ad-hoc database queries report

Problem in database schema after upgrading Ad-hoc database queries report

by Séverin TERRIER -
Number of replies: 3
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hi,

I've recently updated my Ad-hoc database queries report plugin to latest version (3.0) on Moodle 2.9.2, and now, when i launch admin/cli/check_database_schema.php, i've got :
-------------------------------------------------------------------------------
report_customsql_categories
 * column 'name' should be NOT NULL (C)
 * column 'name' has default 'Miscellaneous', expected 'NULL' (C)
-------------------------------------------------------------------------------

It seems something was not well handled when upgrading.

Séverin

Average of ratings: -
In reply to Séverin TERRIER

Re: Problem in database schema after upgrading Ad-hoc database queries report

by Séverin TERRIER -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi,

i then launched XMLDB editor, and started default values check, which showed :
Table: report_customsql_categories. Champ: name, Valeur attendue '' Valeur actuelle 'Miscellaneous'
ALTER TABLE mdl_report_customsql_categories MODIFY COLUMN name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' after id;

After launching the SQL, i tried again the two checks, and everything was OK (after purging caches) smile

Séverin

PS : would be useful if check_database_schema.php could also have an option to make corrections, or at least provide a list of SQL commands for that
In reply to Séverin TERRIER

Re: Problem in database schema after upgrading Ad-hoc database queries report

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In reply to Tim Hunt

Re: Problem in database schema after upgrading Ad-hoc database queries report

by Séverin TERRIER -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

I don't know exactly what happened.

Just can say i'm using Moodle 2.9.2, was using latest existing version of "Ad-hoc database queries report" and upgraded to the 3.0 version (using web installer) when it came out in plugin database.

Fixed for me with the SQL command provided by default values check in XMLDB editor.