...
In LiteFarm, we almost always use “soft deletes”. This means that when a user “deletes” data in the app what’s actually happen happening is we’re setting a flag in the database that says that data is now deleted, e.g. deleted = true. A “hard delete” is when the row of data is actually just removed from the table altogether. In LiteFarm, the user interface knows to not display those records that have deleted = true. As such, you’ll also need to make sure and exclude deleted records when you’re pulling information from the database or risk pulling incorrect information. In most cases this just means you’ll need to add the following to whatever table or tables you’re querying:
...
For this, we’ll need to join the user, userFarm, and farm tables.
Looking at the ERD we can see:
...