Take this scenario:
I have a couple tables that are linked together as siblings in a many
to many relationship -- we'll say pet and breed.
Now, when I want to delete a pet deeply -- it makes sense in my
application to leave breed untouched, though it currently goes right
ahead and deletes it. Another pet may be linked to the breed just
deleted.
Does it make sense to leave the deepest part of a many to many
relationship untouched in all circumstances?
I see what you mean, and I think I agree. Another question is, if you
delete pet deeply and the breed(s) associated with that pet do(es) not
have other siblings at the time of the delete, should it/they then be
deleted? i'm not sure what the intuitive behavior is in that case. we
can
1) never delete anything more than the mapping when it comes to
siblings, or
2) delete the mappings AND the corresponding sibling objects if they
are not connected.
I think 1 is acceptable and would keep things consistent and simple...
and we would leave the cleaning of 'orphaned' siblings to the user /
get a plugin to do that.
Joel
Thanks :)
Garett
1.when $deep is set to true, it would delete all children recursively,
but not the other siblings
2.when $across is set to true, it would delete all siblings
recursively
3.internal mappings are deleted no matter what
4.Setting both to true would have the equivalent effect of the current
deep = true.
5.Setting both to false would have the equivalent of the current deep
= false.
Comments?
Regards,
Joel
On Feb 15, 1:37 pm, "Garett" <goot...@gmail.com> wrote:
> I think that would be logical.
>
> Thanks :)
> Garett
>
> On Feb 15, 12:50 pm, "Joel" <joel...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > I see what you mean, and I think I agree. Another question is, if you
> >deletepet deeply and the breed(s) associated with that pet do(es) not
> > have other siblings at the time of thedelete, should it/they then be
> > deleted? i'm not sure what the intuitive behavior is in that case. we
> > can
>
> > 1) neverdeleteanything more than the mapping when it comes to
> > siblings, or
> > 2)deletethe mappings AND the correspondingsiblingobjects if they
> > are not connected.
>
> > I think 1 is acceptable and would keep things consistent and simple...
> > and we would leave the cleaning of 'orphaned' siblings to the user /
> > get a plugin to do that.
>
> > Joel
>
> > On Feb 14, 5:44 pm, "Garett" <goot...@gmail.com> wrote:
>
> > > I have a situation that I don't think is being handled properly...
>
> > > Take this scenario:
>
> > > I have a couple tables that are linked together as siblings in a many
> > > to many relationship -- we'll say pet and breed.
>
> > > Now, when I want todeletea pet deeply -- it makes sense in my
> > > application to leave breed untouched, though it currently goes right
> > > ahead and deletes it. Another pet may be linked to the breed just
> > > deleted.
>
> > > Does it make sense to leave the deepest part of a many to many
> > > relationship untouched in all circumstances?- Hide quoted text -
>
> - Show quoted text -