I created a new installation of a Magento 2.3.5-p2 and I want to use or get the data from a database that were used in a Magento 2.2 installation. I corrected the type from some tables that could not be enum that's fine but then this appears when I run setup:upgrade

Notice: Undefined index: CUST_pecustomer_entity in /var/www/webroot/ROOT/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152

And idk what to do, it doesn't seem to be an old extension problem that's a core table that's why I'm kinda lost here. I checked in app/etc/config.php and the search is already at 'Magento_Search' => 1 and searched database for any references to CUST_pecustomer_entity but no luck. Any solution for this?

Thanks :D

1 Answer 1


I found an answer that helped, in vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php:148 change to this

//Prepare reference data
                $referenceData['table'] = $table;
                $referenceTableName = $referenceData['referenceTable'];
                $referenceData['column'] = $table->getColumnByName($referenceData['column']);
                $referenceData['referenceTable'] = $this->tables[$referenceTableName];
                $referenceData['referenceColumn'] = $referenceData['referenceTable']->getColumnByName(

it will return the table that is giving errors. You should override this file so you can edit, in my case I just wanted to use one time so edited directly in vendor and then reverted it, if you want to keep it override the file. I don't advise doing this on a production server. Hope it helps someone!

  • May I ask why downvote? Only wanted to help someone with a similar problem since the warning that Magento gives by default is not that great, I could never find where it was with just the default warning. But if someone wants to add something or have a better way I would appreciate it, this one was what I found so I could solve the problem and I lost a couple of hours just to get that little debug so I could solve the problem so I didn't want someone to lose that many time with this :D
    – Rui Silva
    Jun 24, 2020 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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