DDC-808: Deleted OneToOne relationship not detected #995

Closed
opened 2026-01-22 12:58:23 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 15, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user lstrojny:

When using automatic change detection, the attached scenario is not detected. I have an aggregate root with a OnetoOne relation. The OneToOne relation to OTORel is set up in OneToOne::start(). The creation of the OTORel is detected and stored. But when OneToOne::stop() sets the OTORel instance to null, the instance is not removed from the database.

Result:

mysql> select * from OTORel;
<ins>----</ins>
| id |
<ins>----</ins>
|  1 |
<ins>----</ins>
1 row in set (0.00 sec)

mysql> select * from OneToOne;
<ins>----</ins>
| id |
<ins>----</ins>
|  1 |
<ins>----</ins>
1 row in set (0.00 sec)

Expected result would be, that the OTORel table is empty.

Originally created by @doctrinebot on GitHub (Sep 15, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user lstrojny: When using automatic change detection, the attached scenario is not detected. I have an aggregate root with a OnetoOne relation. The OneToOne relation to OTORel is set up in OneToOne::start(). The creation of the OTORel is detected and stored. But when OneToOne::stop() sets the OTORel instance to null, the instance is not removed from the database. Result: ``` mysql> select * from OTORel; <ins>----</ins> | id | <ins>----</ins> | 1 | <ins>----</ins> 1 row in set (0.00 sec) mysql> select * from OneToOne; <ins>----</ins> | id | <ins>----</ins> | 1 | <ins>----</ins> 1 row in set (0.00 sec) ``` Expected result would be, that the OTORel table is empty.
admin added the Bug label 2026-01-22 12:58:23 +01:00
admin closed this issue 2026-01-22 12:58:23 +01:00
Author
Owner

@doctrinebot commented on GitHub (Sep 21, 2010):

Comment created by @beberlei:

I think I found the problem, you have defined "mappedBy" on both relations. Hence both relations sides are the Inverse side, none the owning. Try:

doctrine orm:validate-schema

does this give an error for you?

@doctrinebot commented on GitHub (Sep 21, 2010): Comment created by @beberlei: I think I found the problem, you have defined "mappedBy" on both relations. Hence both relations sides are the Inverse side, none the owning. Try: ``` doctrine orm:validate-schema ``` does this give an error for you?
Author
Owner

@doctrinebot commented on GitHub (Oct 31, 2010):

Comment created by @beberlei:

No further feedback was provided, closing due to invalid mapping.

@doctrinebot commented on GitHub (Oct 31, 2010): Comment created by @beberlei: No further feedback was provided, closing due to invalid mapping.
Author
Owner

@doctrinebot commented on GitHub (Oct 31, 2010):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Oct 31, 2010): Issue was closed with resolution "Invalid"
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 3 attachments from Jira into https://gist.github.com/eee5aa346ad71eb73280

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 3 attachments from Jira into https://gist.github.com/eee5aa346ad71eb73280 - [10801_OneToOne.php](https://gist.github.com/eee5aa346ad71eb73280#file-10801_OneToOne-php) - [10802_oto.php](https://gist.github.com/eee5aa346ad71eb73280#file-10802_oto-php) - [10803_OTORel.php](https://gist.github.com/eee5aa346ad71eb73280#file-10803_OTORel-php)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#995