Skip to content

Conversation

@ScottVerbeek
Copy link

Noticed the current id column has been used a foreign key. This caused a database schema error. Below you can see the before and after upgrade results.

root@2886180ea26f:/var/www/vanilla-401# php admin/cli/check_database_schema.php 
-------------------------------------------------------------------------------
block_grade_me
 * Missing index 'id' (not unique (id)). 
CREATE INDEX mdl_blocgradme_id_ix ON mdl_block_grade_me (id);
-------------------------------------------------------------------------------
root@2886180ea26f:/var/www/vanilla-401# php admin/cli/upgrade.php 
== Upgrading Moodle database from version 4.1.8 (Build: 20231222) (2022112808) to 4.1.8 (Build: 20231222) (2022112808) ==

Your Moodle files have been changed, and you are about to automatically
upgrade your server to this version:

4.1.8 (BUILD: 20231222) (2022112808)

Once you do this you can not go back again. Please note that this process
can take a long time.

Are you sure you want to upgrade this server to this version?

type y (means yes) or n (means no)
: y
-->block_grade_me
++ 2024013100: Success (0.09 seconds) ++
++ Success (0.16 seconds) ++
-->upgrade_noncore()
++ Success (0.39 seconds) ++
== Setting new default values ==
Command line upgrade from 4.1.8 (Build: 20231222) (2022112808) to 4.1.8 (Build: 20231222) (2022112808) completed successfully.
root@2886180ea26f:/var/www/vanilla-401# php admin/cli/check_database_schema.php 
Database structure is ok.

@duyhuynhdev duyhuynhdev force-pushed the issues-81-database-schema-issue branch from e2c9dac to d6b24bd Compare September 30, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants