Hi, I would allow DBIx::Class to manage the relationships, i.e. try removing 'REFERENCES user(id)' from your table schema. It's creating a database foreign key which is preventing the deletion, and as the doc says,
By default, DBIx::Class cascades deletes across has_many, has_one 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, 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.
Hope this helps!
In reply to Re: Using DBIx::Class To Delete Row With Foreign Keys
by 1nickt
in thread Using DBIx::Class To Delete Row With Foreign Keys
by varanasi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |