[Dbix-class] Disable cascading delete, but then...?

Bill Moseley moseley at hank.org
Sun Jun 12 13:54:04 GMT 2011


On Sun, Jun 12, 2011 at 3:53 AM, Jesse Sheidlower <jester at panix.com> wrote:

> Are there standard ways of dealing with this automatically, so that, for
> example, deleting the status will instead set the status_id column of
> all related words to NULL? Or what else are the usual solutions?
>

Something like this for your DB?

 status_id  integer REFERENCES status ON DELETE SET NULL

But does it make sense to allow nulls?  Seems like you would want to prevent
a status from being deleted if it's still in use.

-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20110612/6b6=
682f6/attachment.htm


More information about the DBIx-Class mailing list