Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Image RemovedImage Added

Looking at the ERD we can see:

...