Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2894

on-update cascade for one-to-one association

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.3.4, 2.4.1
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:

      Description

      I'm trying to use on-update cascade in a one-to-one association but it ends in on-update restrict when I update the database tables.
      I'm using XML Definition an my definition for this specific association looks like this:

      <one-to-one field="scope" target-entity="Application\Entity\Scope">
      <join-column name="scope_id" referenced-column-name="id" nullable="false" on-delete="CASCADE" on-update="CASCADE" />
      <cascade>
      <cascade-persist />
      <cascade-remove />
      </cascade>
      </one-to-one>

      This works pretty well when I use on-update="CASCADE" in a many-to-one association, but one-to-one just ignores it.
      When I change the database manually everything works well, but the next update from command line will override it.

        Activity

        Hide
        Pradeep Krishnan added a comment -

        Any updates on this one?

        Show
        Pradeep Krishnan added a comment - Any updates on this one?
        Hide
        Marco Pivetta added a comment -

        We don't support on-update anymore, as identifiers should be immutable.

        Show
        Marco Pivetta added a comment - We don't support on-update anymore, as identifiers should be immutable.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            I. S.
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: