Re: How to store/manage tags?

From: J.O. Aho <user_at_example.net>
Date: Sun, 14 Jul 2019 08:57:55 +0200
Message-ID: <gp023jF4tmiU1_at_mid.individual.net>


On 13/07/2019 18.22, Lew Pitcher wrote:

> FWIW, if you add "ON DELETE CASCADE" to those two foreign keys, then mysql
> will delete the corresponding restauanttag row if you delete either the
> id_restaurant from the restaurants table (say, on a restaurant out-of-
> business), or the id_tag from the tags table (say, an obsolete tag). This
> makes maintenance of the restauranttag table easier, as it will have no
> "hanging" FK references.

[Quoted] [Quoted] This don't work on all types of storage engines like MyISAM and you will also get the issue of accidental deletion of everything. I wouldn't use it myself, as I do like the nice error you get with you try to delete something that has a foreign key restriction.

-- 

  //Aho
Received on Sun Jul 14 2019 - 08:57:55 CEST

Original text of this message