CodeIgniter Forums
DMZ unwanted house cleaning - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: DMZ unwanted house cleaning (/showthread.php?tid=39706)



DMZ unwanted house cleaning - El Forum - 03-18-2011

[eluser]TomMRiddle[/eluser]
We have used DMZ latest version on a rather big project and noticed that the house cleaning is unlinking deleted objects to related tables. I understand that this may be desirable if you use MyISAM where there are no foreignkey support but we use InnoDB and use on delete cascade on stuff that should clean itself.

When DMZ does its house cleaning it completely breaks the on delete cascade behavior because the objects are no longer related so we have to tell DMZ to delete the related object before deleting the "parent" object. we can live with this but it got us really irritated at DMZ when we realized what it was doing. is there a way to turn off house cleaning?


DMZ unwanted house cleaning - El Forum - 03-18-2011

[eluser]WanWizard[/eluser]
Datamapper does NOTHING on it's own. It does what it's programmed to do. If you use database mechanisms, whether you're using constraints or triggers, YOU are bypassing Datamappers logic.

If you want the option to alter Datamappers logic in this respect, please add a feature request at http://bitbucket.org/wanwizard/datamapper/issues.


edit: new config value 'cascade_delete' implemented (global, per model, or per relationship definition), default enabled. Set to FALSE to disable it. Download at https://bitbucket.org/wanwizard/datamapper/get/tip.zip.


DMZ unwanted house cleaning - El Forum - 03-19-2011

[eluser]TomMRiddle[/eluser]
Thank you for the cascade_delete "powerswitch" much appriciated.


DMZ unwanted house cleaning - El Forum - 03-19-2011

[eluser]WanWizard[/eluser]
Thanks.

I see the need for a feature like this once you move on to a "more professional" database design.


DMZ unwanted house cleaning - El Forum - 03-22-2011

[eluser]WanWizard[/eluser]
?


DMZ unwanted house cleaning - El Forum - 03-22-2011

[eluser]bEz[/eluser]
I'm curious, what is the "?" in your previous post referring to WanWizard?


DMZ unwanted house cleaning - El Forum - 03-22-2011

[eluser]WanWizard[/eluser]
There was a rubbish post before mine, which seems to be removed (maybe a spammer?)...