Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrity constraint violation when purging database #94

Closed
alsar opened this issue Jun 29, 2013 · 3 comments
Closed

Integrity constraint violation when purging database #94

alsar opened this issue Jun 29, 2013 · 3 comments

Comments

@alsar
Copy link

alsar commented Jun 29, 2013

I get an error when i try to execute doctrine:fixtures:load and the database is purged.

Symfony > doctrine:fixtures:load
Careful, database will be purged. Do you want to continue Y/N ?y
  > purging database

  [Doctrine\DBAL\DBALException]                                                                
  An exception occurred while executing 'DELETE FROM messaging_inbox':                         

  SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row:  
   a foreign key constraint fails (`ruw`.`profile`, CONSTRAINT `FK_8157AA0F18DA89DD` FOREIGN  
   KEY (`inbox_id`) REFERENCES `messaging_inbox` (`id`))                                       

  [PDOException]                                                                               
  SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row:  
   a foreign key constraint fails (`ruw`.`profile`, CONSTRAINT `FK_8157AA0F18DA89DD` FOREIGN  
   KEY (`inbox_id`) REFERENCES `messaging_inbox` (`id`))                                       

doctrine:fixtures:load [--fixtures[="..."]] [--append] [--em="..."] [--purge-with-truncate]

The command terminated with an error status (1)

I'm using the latest master.

@rkmax
Copy link

rkmax commented Oct 1, 2014

+1 Please fix this issue with the flag --purge-with-truncate

@lavoiesl
Copy link
Member

See doctrine/data-fixtures#127

@danaki
Copy link

danaki commented Jul 1, 2019

Still actual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants