Unable to perform DELETE ALL operation. [wrapped: SQLSTATE[23000]:
Integrity constraint violation: 1451 Cannot delete or update a parent
row: a foreign key constraint fails (`pw_catsub`, CONSTRAINT
`pw_catsub_FK_1` FOREIGN KEY (`category_id`) REFERENCES `pw_catsub`
(`id`))]
I get the above message when trying to re-insert the fixtures data
on the database (e.g. rerun symphony propel:data-load ). The
aforementioned foreign key is onDelete: restrict(ed). This is a table
with self-reference (e.g. the foreignTable is the same table) and it
implements a category-subcategory item modeling.
I expect for the data-load script to delete all the old values in
the opposite direction they were inserted before reinserting. By
examining sfPropelData.class.php this seems to be the case. Also by
deleting the records manualy in the oposite order as they are created
no error happens. So i think there is some bug that doesn't follow the
ordering rule, and i cannot point out.
----
help data:
table:
pw_catsub:
id: ~
name: { type:varchar(255), required: true,
index:unique }
category_id: { type: integer, foreignTable: pw_catsub,
foreignReference: id, default: null, onDelete: restrict }
fixture:
PwCatsub:
nature: { name: nature }
news: { name: news }
# subs
politics: { category_id: news, name: politics }
economy: { category_id: news, name: economy }
-
basos
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---