Update of questionnaire module threw an error

Update of questionnaire module threw an error

by Heather P -
Number of replies: 2

Hello

I'm on a Moodle 3.8 with MS SQL database version 12 on Windows.

I just tried to upgrade the questionnaire module to the latest and got this error. I downloaded it this morning. File name mod_questionnaire_moodle38_2020011507

Debug info: SQLState: 42000<br>
Error Code: 156<br>
Message: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'IDENTITY'.<br>

ALTER TABLE mdl_questionnaire_response_bool ALTER COLUMN id BIGINT NOT NULL IDENTITY(1,1)
Error code: ddlexecuteerror

Stack trace:

  • line 492 of \lib\dml\moodle_database.php: ddl_change_structure_exception thrown
  • line 324 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
  • line 772 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
  • line 77 of \lib\ddl\database_manager.php: call to sqlsrv_native_moodle_database->change_database_structure()
  • line 597 of \lib\ddl\database_manager.php: call to database_manager->execute_sql_arr()
  • line 905 of \mod\questionnaire\db\upgrade.php: call to database_manager->change_field_type()
  • line 826 of \lib\upgradelib.php: call to xmldb_questionnaire_upgrade()
  • line 532 of \lib\upgradelib.php: call to upgrade_plugins_modules()
  • line 1877 of \lib\upgradelib.php: call to upgrade_plugins()
  • line 711 of \admin\index.php: call to upgrade_noncore()
The upgrade to 3.8 and suitable questionnaire module I only did last week so I was not going from a particularly old questionnaire  and it told me this morning that there was a newer questionnaire.

I'm not good with understanding SQL errors so any guidance appreciated.

Thank you.

Heather

Average of ratings: -
In reply to Heather P

Re: Update of questionnaire module threw an error

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
I believe this is caused by the CONTRIB-8096 issue. If you are in a hurry and can make your own changes, there is a code correction in the last comment of that issue that will fix it. Otherwise, I will get a new release out with that fix soon.