[Dbix-class] (no subject)
Matt S Trout
dbix-class at trout.me.uk
Thu May 29 11:34:00 BST 2008
On Fri, May 16, 2008 at 11:56:03PM +0100, Pedro Melo wrote:
> Hi,
>
> I'm using a database with foreign key constraints that supports
> cascade deletes. I'm also using DBIx::Class::Schema::create_ddl_dir
> to generate the SQL.
>
> So I use the cascade_delete relation attribute to control the
> generated SQL.
>
> My problem is that a true value there also enables the internal
> DBIx::Class cascade delete (the sub delete in DBIx::Class::
> Relationship::CascadeActions does that) and looking at that code
> there is no way to disable the behavior without compromising the SQL
> generation. And this generates queries that really don't serve any
> purpose because the DB already did it.
>
> I was thinking about adding a flag to the storage layer that a user
> could turn on stating "yes, I have a modern database, don't do
> cascade deletes".
>
> Would that be the proper place to do it? Any other suggestions?
I thought somebody already did a patch that allowed "software_cascade => 0"
on the rels. I thing both would probably be useful.
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/
More information about the DBIx-Class
mailing list