Comment 4 for bug 877494

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Re: [Bug 877494] Re: deleting a device_type fails

On Wed, 19 Oct 2011 08:57:15 -0000, Zygmunt Krynicki <email address hidden> wrote:
> W dniu 19.10.2011 04:32, Michael Hudson-Doyle pisze:
> > OK, after a bit more poking I've come to the conclusion that we should
> > not edit device_type ever.
> >
> > Fortunately there's no real state in a device_type so we can add a type,
> > move all references over to the new type and then delete the old one --
> > but do this using psql, not django.
>
> Django allows the same thing to happen, see on_delete in the model docs.

Huh? Which same thing do you mean? The bit you're replying to is
talking about modifying primary keys, which is clearly a sketchy thing
to be doing but Django reacts to very strangely.

I'm aware of on_delete -- it's documented as defaulting to CASCADE
though, which clearly isn't happening here (even though I think it's a
bonkers default).