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
--purge-with-truncate option fails #26
Comments
This is pretty much normal if you didn't correctly setup cascade operations. |
Are you sure? My DB is mysql 5.5 and it appears it can't truncate tables with foreign keys... This is the mySQL documentation : TRUNCATE TABLE fails for an InnoDB table if there are any FOREIGN KEY constraints from other tables that reference the table. Foreign key constraints between columns of the same table are permitted. |
Did you also set |
Yes, i tried to add onDelete="CASCADE" on my entity property and i had the same issue. SET FOREIGN_KEY_CHECKS=0; TRUNCATE table1; SET FOREIGN_KEY_CHECKS=1; Do you think that could be used? |
@Gawel1 that is a quite bad idea and can lead to FK constraint inconsistencies. I'll redirect you to doctrine/data-fixtures#17, since the module here simply pushes the flags one level down to data-fixtures |
When i try to purge data with purge-with-truncate option before insert fixtures, i have a SQL error :
The text was updated successfully, but these errors were encountered: