Skip to content

Failed to add the foreign key constraint ‘—/CUSTOMER_ENTITY_STORE_ID_STORE_STORE_ID’ to system tables

On running the setup:upgrade command I’m receiving this error on Schema generation.

Schema creation/updates:
SQLSTATE[HY000]: General error: 1823 Failed to add the foreign key constraint ‘/CUSTOMER_ENTITY_STORE_ID_STORE_STORE_ID’ to system tables, query was: ALTER TABLE customer_entity ADD CONSTRAINT CUSTOMER_ENTITY_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE SET NULL, ADD CONSTRAINT CUSTOMER_ENTITY_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID FOREIGN KEY (website_id) REFERENCES store_website (website_id) ON DELETE SET NULL