From 8643512d93df56fe875db69d0cfdd52666743f2f Mon Sep 17 00:00:00 2001 From: Matt Barlow Date: Wed, 16 Nov 2016 10:35:40 -0600 Subject: [PATCH] Remove unused entity_id foreign key This removes the entity_id foreign key from the catalog_product_entity_media_gallery table. The entity_id column is dropped in UpgradeSchema.php, so the foreign key can never be created. This patch fixes a fatal error on AWS Aurora. --- app/code/Magento/Catalog/Setup/InstallSchema.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/app/code/Magento/Catalog/Setup/InstallSchema.php b/app/code/Magento/Catalog/Setup/InstallSchema.php index a2ba6aa283f65..624ed2fb4ba56 100644 --- a/app/code/Magento/Catalog/Setup/InstallSchema.php +++ b/app/code/Magento/Catalog/Setup/InstallSchema.php @@ -2022,18 +2022,6 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'attribute_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE ) - ->addForeignKey( - $installer->getFkName( - 'catalog_product_entity_media_gallery', - 'entity_id', - 'catalog_product_entity', - 'entity_id' - ), - 'entity_id', - $installer->getTable('catalog_product_entity'), - 'entity_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE - ) ->setComment( 'Catalog Product Media Gallery Attribute Backend Table' );