Delete the data from a table of a dating application

I’ve considered doing something like this in my app to clean up old data.

  • What I would do is create an IF column in the table with the dates. The IF column would check if the date is prior to Now. If it is, then return ‘true’ for a value.
  • Then I would pick a section of the app that is viewed often by users. In the table that drives that part of the app, I would first create a template column with the word ‘true’. Then I would create a single relation that links the template column to the IF column in whichever table contains the dates.
  • Now when a user clicks on a list item, for example, you can turn the action into a custom action that will first delete the dated row through the single relation, followed by going to the detail screen of the selected item.

The user will have no idea that they are the ones deleting the old rows. It’s not an automated process, but the more that a person uses the app, the more the old records will be deleted.

So, the trick is really to delete the row through a single relation, but make sure that the single relation only relates to rows with dates that have already passed.

I kind of do something similar in my calculator app. I have a rolling history table that keeps a history of the last 20 calculations that were done by the user. The table only ever has 20 rows. No more, no less. I have some logic in the history table that checks timestamps and ultimately marks the next row that should be updated. Then the calculator table has a single relation that links to only that row in the history table that’s marked as next, and that is the row that is updated when the user presses the equal button. It’s a little more complicated than you would need, but I think if you can mark the rows with some IF logic as the ones that need to be deleted, then a single relation to that marked row and a delete action that deletes through that relation should work for you.