Click here to Skip to main content
13,799,715 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
When I do,

php bin/console doctrine:schema:update --force


I get,




Updating database schema...

                                                                               
  [Doctrine\DBAL\Exception\DriverException]                                    
  An exception occurred while executing 'ALTER TABLE book ADD CONSTRAINT FK_C  
  BE5A33112469DE2 FOREIGN KEY (category_id) REFERENCES category (id)':         
                                                                               
  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint       
                                                                               

                                                                          
  [Doctrine\DBAL\Driver\PDOException]                                     
  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint  
                                                                          

                                                                          
  [PDOException]                                                          
  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint  


What I have tried:

Updating the entity and yml files and running
php bin/console doctrine:schema:update --force
Posted 3-Jan-18 0:20am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web02 | 2.8.181207.3 | Last Updated 3 Jan 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100