Git Product home page Git Product logo

Comments (2)

mbabker avatar mbabker commented on July 3, 2024

IIRC the JoinColumn::$onDelete config is only used to configure the foreign key column in the database, the ORM doesn't use that to make any decisions about mapping relationships. Actually, the only place I can find the ORM using that information is in the UnitOfWork when it is determining the order of operations for DELETE statements, and it only takes into consideration "cascade" and "set null".

It does look like right now it's known the ORM might not work as expected with onDelete="restrict", see doctrine/orm#10783 for that.

So I don't think we have an actionable bug within this package at the moment, if something changes in the ORM around this situation then things can be updated here if need be.

from doctrineextensions.

joosee7 avatar joosee7 commented on July 3, 2024

It seems there might be some confusion here. While it's true that JoinColumn::$onDelete primarily configures the behavior of the foreign key column in the database, its impact extends beyond that. In MySQL, onDelete="restrict" should enforce that a referenced row cannot be deleted while it's still referenced by another table.

However, if this isn't being reflected as expected in the ORM, it could indeed be considered a bug. While the ORM may currently handle onDelete="cascade" and "set null" appropriately, the fact that onDelete="restrict" isn't behaving as anticipated could signify a bug.

The reported behavior should ideally align with database behavior for consistency and predictability.

from doctrineextensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.