[FEATURE] Idea for hard delete vs. soft delete

Can you remind us what soft delete is used for again? The example you had of “inactive accounts” sounds very high-level, not something the database should be aware of. I think soft delete has caused more confusion than use. Who uses it and where is it used currently?

I even forget what triggers it. I create a new unique field and add data, then delete the row and create a new one with the same data, so I don’t see this “soft delete”. Was it something to do with mandatory?

Mike

Thanks for your response @sebastian.scholl. And sorry for my slow reply - I’ve been under the weather this week. I really do appreciate your getting back on this though.

I’m with @mike_ekim1024 in stepping back and asking if soft delete is a necessary feature. Is it a feature that is requested or taken advantage of? I find it more confusing than useful, and it seems (as others have suggested) that a database field with an active/inactive flag would much more easily fulfill the suggested use case than soft deletion would. Then, deletion would simply delete (permanently), which I think is the expected behavior.

If you are going to go forward with both soft and hard delete, then I’d lean toward Strategy 2/3. However, can you clarify the part where you say “Any mandatory relationships will cascade the delete/destroy operation run on the parent when the force flag is specified”?

I find the current feature very confusing. You don’t notice anything about soft delete if you check the No Duplicate Values flag when creating the field. You can add and delete as many times as you want with the same unique value. If you later check No Duplicate Values, then I see it. Why is there a difference, and is soft delete still happening in the former case, but the row is being re-used so it looks like a successful add?

TEST CASE:

  • Add a new table and name it “Test”
  • Add a field “title” of type Text
  • Set validation to Mandatory and No Duplicate Values
  • Click Create Field
  • Add a row with title “abc” and click Add Row
  • Select the row and click Delete selected records
  • Add a row with title “abc” and click Add Row

So far this works fine. Is the row being deleted, and recreated, or is it being re-used?

  • Go back to the schema editor and uncheck the No Duplicate Values flag on the title field
  • Click Save Field
  • Now turn it back on by checking No Duplicate Values and click Save Field
  • This results in an error saying:
    “The field ‘title’ has non uniques values. Please remove duplicate values and repeat the operation. Non unique values are: abc.”

I always check No Duplicate Values when creating fields and I know that there should be no duplicates, so I don’t encounter this problem. If records are soft deleted, how do you delete them currently, and who/what is using this feature currently? This also affects quotas (although I think it has been fixed). What if someone creates thousands of temporary rows. Currently they will live on as phantom rows taking disk space?