Using the latest version of Magent2; 2.3.5 currently. When running the setup:upgrade query, we are hitting the below error:

Notice: Undefined index: store in /siteurl/public/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152

Looking at the store table, the admin ID has at somepoint changed from 0 to 2. Which is the likely issue. When restoring an old backup of this table, the id of 2 remains.

How is the above error rectified?


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: https://prnt.sc/sjjvww

  • Yes, that was it, thanks. – MagentoMac May 19 '20 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.