On Sun, Jun 12, 2011 at 3:53 AM, Jesse Sheidlower <[email protected]> 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
[email protected]
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to