Welcome Guest, Not a member yet? Register   Sign In
ON DELETE CASCADE for Foreign Keys

Hello fam,
I want to know what would happen to rows that have soft_deletes set to true in the model.
Does it set the child rows deleted_at colum to null or it deletes all rows regardless?

From the documentation:

If true, then any delete() method calls will set deleted_at in the database, instead of actually deleting the row. This can preserve data when it might be referenced elsewhere, or can maintain a “recycle bin” of objects that can be restored, or even simply preserve it as part of a security trail. If true, the find*() methods will only return non-deleted rows, unless the withDeleted() method is called prior to calling the find*() method.

Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com

If I understand you, if the soft deletes is set to true AND ON Delete is CASCADE, records will still be kept.

When it comes to using soft deletes and CASCADE, that I don't know. You'll have to wait for a dev to reply.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com

It would be nice if someone from the dev team could answer this. @kenjis @includebeer any thoughts on this?

Quote:The CodeIgniter’s Model provides convenience features and additional functionality that people commonly use to make working with a single table in your database more convenient.


It does nothing to CASCADE or child tables.

Theme © iAndrew 2016 - Forum software by © MyBB