Welcome Guest, Not a member yet? Register   Sign In
Soft Delete VS hard Delete
#4

(09-22-2018, 02:30 AM)CINewb Wrote: Whilst I agree soft deletes are nice because it's easy to correct "mistakes" I think there are other implications.

If you have a table that is used in dozens and dozens of queries, then every single query is going to have to include an extra condition on the field that indicates whether the row is deleted or not.  Any ommissions here could have undesired consequences that might not be noticed for quite a while.  For example the calculation of a customer's balance that doesn't account for invoices that have been deleted won't be noticed until some invoices actually get deleted.

I completely agree, one reason I was against doing soft deletes is that exact example. In your query, say if you are doing invoices, if you forget to say, list all invoices where soft delete != true, then you could have a big problem on your hands.

That being said, it is more of a coding implementation issue rather than a system issue, but it does add an additional worry or headache for all other queries the programmer is writing.

Especially as EVERY database table should have a soft delete column if you are doing it properly.

My initial idea was, once I decided on having a soft delete for all tables, I would simply integrate this into my crud generator so I would never have the embarrassment of missing data.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Reply


Messages In This Thread
Soft Delete VS hard Delete - by ignitedcms - 09-15-2018, 01:20 AM
RE: Soft Delete VS hard Delete - by Paradinight - 09-15-2018, 02:20 AM
RE: Soft Delete VS hard Delete - by CINewb - 09-22-2018, 02:30 AM
RE: Soft Delete VS hard Delete - by ignitedcms - 09-22-2018, 01:45 PM
RE: Soft Delete VS hard Delete - by Pertti - 09-23-2018, 08:16 AM
RE: Soft Delete VS hard Delete - by ignitedcms - 09-25-2018, 11:44 AM
RE: Soft Delete VS hard Delete - by qury - 09-25-2018, 11:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB