5

After Upgrade 2.2.5 To 2.3.0 when i am runnung php bin/magento setup:upgrade it give bellow error:

Schema creation/updates:

SQLSTATE[HY000]: General error: 1823 Failed to add the foreign key constraint 'test@test@002dtestnew/CMS_BLOCK_STORE_BLOCK_ID_CMS_BLOCK_BLOCK_ID' to system tables, query was: ALTER TABLE cms_block_store MODIFY COLUMN block_id smallint(6) NOT NULL , ADD CONSTRAINT CMS_BLOCK_STORE_BLOCK_ID_CMS_BLOCK_BLOCK_ID FOREIGN KEY (block_id) REFERENCES cms_block (block_id) ON DELETE CASCADE, ADD CONSTRAINT CMS_BLOCK_STORE_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE CASCADE

Manashvi Birla
  • 8,833
  • 9
  • 27
  • 53
Navin Bhudiya
  • 2,988
  • 9
  • 37
  • 69

1 Answers1

9

The error was due to Duplicate tables in a database, BK_cms_block. I copied table and renamed it for backup purpose and the table was creating issue , so I just deleted BK tables and the error got resolved!

Abhishek Tripathi
  • 2,885
  • 2
  • 18
  • 37
Navin Bhudiya
  • 2,988
  • 9
  • 37
  • 69