Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

stop DBIx::Class from attempting to cascade deletes on my has_many and might_have relationships?

0
Posted

stop DBIx::Class from attempting to cascade deletes on my has_many and might_have relationships?

0

By default, DBIx::Class cascades deletes and updates across has_many and might_have relationships. You can disable this behaviour on a per-relationship basis by supplying cascade_delete => 0 in the relationship attributes. The cascaded operations are performed after the requested delete or update, so if your database has a constraint on the relationship, it will have deleted/updated the related records or raised an exception before DBIx::Class gets to perform the cascaded operation. See DBIx::Class::Relationship.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123