Versions Compared

Key

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

...

The above user table has 2 records. One for Jane Doe and another for Zues. Videos 1 - 10 in the reference videos section above give you background on many ways you can modify or display specific columns on individual tables - so please watch them and experiment. However, where things get really interesting is video 11. In this video, Nathan shows us how to connect different tables together using primary and foreign keys using an operation called a “JOIN”. This is a somewhat difficult concept, but is absolutely essential to getting the most of the LiteFarm database. We’ll get into that in just a moment, but first…

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 then 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:

Code Block
AND deleted = FALSE

...

For this, we’ll need to join the user, userFarm, and farm tables.

Image RemovedImage Added

Looking at the ERD we can see:

...