mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-392: OneToMany cascade delete and InheritanceType("JOINED") table #488
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Mar 6, 2010).
Jira issue originally created by user freeakk:
when delete shellyHost row
@doctrinebot commented on GitHub (Mar 7, 2010):
Comment created by @beberlei:
Just as a note, using 21 subclsses with Joined Inheritence is NOT encouraged. You will get massive performance problems down the road and judging from the base class you don't need them anyways since you could solve the problem using strategy pattern.
Can you try just deleting an inventory basic instance? Does it give the same error?
@doctrinebot commented on GitHub (Mar 7, 2010):
Comment created by @beberlei:
Oh please show us the delete query sql, this could help
@doctrinebot commented on GitHub (Mar 7, 2010):
Comment created by freeakk:
Now I get other error when run $em->remove($shellyHost);
SQL:
My code:
Without error: when delete InventorySystem object:
Also, no error when only create nodes
@doctrinebot commented on GitHub (Mar 7, 2010):
Comment created by freeakk:
Create schema log
@doctrinebot commented on GitHub (Mar 7, 2010):
Comment created by freeakk:
Also I get this error in phpMyAdmin. This error with db schema and keys.
DELETE FROM
test.shelly*hostWHEREshelly*host.id=1 LIMIT 1Ответ MySQL: Документация
#1451 - Cannot delete or update a parent row: a foreign key constraint fails (
test.private*inventory_basic, CONSTRAINTprivate_inventory_basic_ibfk_1FOREIGN KEY (host_id) REFERENCESshelly*host(id))@doctrinebot commented on GitHub (Mar 7, 2010):
Comment created by freeakk:
I need to add this key, but I don't know how.
I think cascade definition don't work with mySQL.
@doctrinebot commented on GitHub (Mar 12, 2010):
Comment created by freeakk:
This is problem with mysql, which requires onDelete="SOME ACTION" and onUpdate="SOME ACTION".
These definitions can be found here
http://www.doctrine-project.org/documentation/manual/2_0/en/annotations-reference%3Areference%3A%40joincolumn
Also there are bug with these definitions
http://www.doctrine-project.org/jira/browse/DDC-409
@doctrinebot commented on GitHub (Mar 12, 2010):
Issue was closed with resolution "Incomplete"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 3 attachments from Jira into https://gist.github.com/7ed0ea4aa1ce416ca5d7