Dear all,
I tried to run setup:upgrade to upgrade database schema but uncountered an error :
bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/var/www/html/EBA/public_html/generated/code/Composer
/var/www/html/EBA/public_html/generated/code/Dotdigitalgroup
/var/www/html/EBA/public_html/generated/code/MSP
/var/www/html/EBA/public_html/generated/code/Magento
/var/www/html/EBA/public_html/generated/code/Symfony
/var/www/html/EBA/public_html/generated/code/Yotpo
Updating modules:
Schema creation/updates:
Notice: Undefined index: gp_media_gallery_asset in /var/www/html/magento/public_html/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152
How can I change the code to have more detailed information.
This index does not exist but I want to know on which table this index is supposed to be.
Thanks for your support
Solved! Go to Solution.
Hi @eric_bangerter,
There is a foreign key in one table which leads to another unexisting table. To find where it is, you should access the file: siteurl/public/vendor/magento/framework/Setup/Declaration/Schema/Db.
Before the line 152, fix the code following this image.
Please let me know if you need further assistance. Hope it helps!
_____________
If issue solved, Click Kudos & Accept as Solution.
Do you have any custom module related to this? If yes then check db_schema.xml file for this module, something wrong in that.
Can you find out this in DB, find out that index key in database.
you can debug by open this file
vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php
and add some debug messages, to see where the problem is. The script stops on FK dependencies on flat tables.
So my solution is to delete them.
After this bin/magento setup:upgrade
will run without error!
Hi @eric_bangerter,
There is a foreign key in one table which leads to another unexisting table. To find where it is, you should access the file: siteurl/public/vendor/magento/framework/Setup/Declaration/Schema/Db.
Before the line 152, fix the code following this image.
Please let me know if you need further assistance. Hope it helps!
_____________
If issue solved, Click Kudos & Accept as Solution.
Hello,
thank you for the contribution, i think i'm facing the same problem when i try to upgrade from 2.2.7 to 2.3.0
Can you please put the fixed code on the comment the screen shott was removed
Thank you
Thanks, i have setuo your way and successful.
Website: https://xsmb99.me/du-doan-xsmb.html
the image is now removed, answers should have a description of the image too because they can always be removed later