<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Matt Lawrence wrote:
<blockquote cite="mid:478B3462.4010907@ymogen.net" type="cite">
  <pre wrap="">Angel Kolev wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">package AppModelDB::AppModel;
use base qw/DBIx::Class/; __PACKAGE__-&gt;belongs_to(archive =&gt;
'AppModelDB::Schedules', 'id',, {join_type =&gt; 'left'}); &lt;snip&gt;



package AppModelDB::Schedules;
use base qw/DBIx::Class/; __PACKAGE__-&gt;has_many(model =&gt;
'AppModelDB::AppModel', 'id');  &lt;snip&gt;

In my script:
$c-&gt;model('AppModelDB::Schedule')-&gt;find({id=&gt;184})-&gt;delete;  
This delete id 184 in AppModelDB::AppModel table too. Why? I dont use
delete_all.

    </pre>
  </blockquote>
  <pre wrap=""><!---->find() returns a row, not a resultset. The delete method in
DBIx::Class::Row always cascades. I think that replacing find with
search here will give you your desired behaviour. If you never want
cascading deletions on that relationship, add { cascade_delete =&gt; 0 } as
a fourth argument to has_many.


Matt</pre>
</blockquote>
Thanks. <br>
<pre wrap="">{ cascade_delete =&gt; 0 } works, 'search' instead of 'find' not.</pre>
</body>
</html>