patrickthibaudeau/moodle-block_course_menu

Upgrade error: Table "block_course_menu_button" does not exist

Closed this issue · 3 comments

Hi @patrickthibaudeau

The latest changes are generating this error due to the name change upgrade step being added after other steps that were affecting the same tables.

The name change should be done before those. I'll send you a PR soon.

-->block_course_menu
Default exception handler: Table "block_course_menu_button" does not exist Debug: 
Error code: ddltablenotexist
* line 146 of /lib/ddl/database_manager.php: ddl_table_missing_exception thrown
* line 287 of /blocks/course_menu/db/upgrade.php: call to database_manager->field_exists()
* line 1118 of /lib/upgradelib.php: call to xmldb_block_course_menu_upgrade()
* line 684 of /lib/upgradelib.php: call to upgrade_plugins_blocks()
* line 1967 of /lib/upgradelib.php: call to upgrade_plugins()
* line 273 of /admin/cli/upgrade.php: call to upgrade_noncore()

Regards,
Guillermo

Hi @patrickthibaudeau

I have added the PRs:

Regards,
Guillermo

Hi @patrickthibaudeau

I saw you added a patch (new commit) moving the re-name step to the top. However, you will need also to remove the duplicated one from the bottom. If not it will throw another error:

Default exception handler: Unknown DDL library error Debug: table probably already renamed
Error code: ddlunknownerror
* line 506 of /lib/ddl/database_manager.php: ddl_exception thrown
* line 358 of /blocks/course_menu/db/upgrade.php: call to database_manager->rename_table()
* line 1118 of /lib/upgradelib.php: call to xmldb_block_course_menu_upgrade()
* line 684 of /lib/upgradelib.php: call to upgrade_plugins_blocks()
* line 1967 of /lib/upgradelib.php: call to upgrade_plugins()
* line 273 of /admin/cli/upgrade.php: call to upgrade_noncore()

My recommendation is to follow my suggestion in the Pull Request. I have rebased it with your latest changes.

Regards,
Guillermo

Thank you @patrickthibaudeau for merging the Pull Requests. Closing this issue now.

Cheers.