sql - MySQL "ON DELETE CASCADE" is too powerful -


Hey, here's the problem below: I have a place, which has a place, if I remove the space for the location table, I do not want to lose the fixed persons, enter an entry in place with id = 1 and name Is: "No place" and that's what I'm trying to do, but I'm unsuccessful!

  Optional table 'Individuals' added contract 'person_ibbb_11' foreign key (`location_id`) reference` location` (`id`) = 1 at DELETE SET` location_id`;  

Thanks!

use on DELETE SET DEFAULT (and make 1 the default value) , Or at DELETE SET NULL . Before manually deleting a third option, all the ids have to be set to 1.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -