Click here to Skip to main content
15,558,869 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900