Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase design for categorized to-do app
    text
    copied!<p>I'm trying to figure out what the best (most logical) way of designing this database for an app that will allow a user to CRUD to-do tasks (more or less), however, they're organized into hard-coded categories.</p> <p>So let's say you're about to go to your favorite department store. You need to hit up the <strong>Women's floor</strong> and pick up your girlfriend the shoes she ordered, and the matching dress (which is on the completely other side of the store, but on the same floor.) Then, you need to go to the <strong>Boy's department</strong> for your little brother, and pick up two different pairs of shorts, one pair of pants, and a new pair of shoes.</p> <p>The Women's Floor and Boy's Department are two examples of categories that the shopping list items will fall into.</p> <p>So it looks like this:</p> <pre><code>* Women's Floor 1 Pair Shoes 1 Dress * Boy's Department 2 Shorts 1 Pant 1 Pair Shoes </code></pre> <p>So my database design could look like so...</p> <pre><code>Categories: id, title ListIndex: id, user_id ShoppingList: id, listindex_id, category_id, item_id, order, active Items: id, name, category_id </code></pre> <p>Categories would be Boy's Department, Women's Floor, etc. Users would not be able to create new categories, but instead, we would predefine the categories</p> <p>ListIndex would provide a master relation to the shopping list as a whole.</p> <p>ShoppingList would be the actual shopping list (active would be 0/1, so the user could have a way to remind themselves that they bought the item / put it in their cart.)</p> <p>Items would have a list of items that are available to put into the to-do tasks. We would categorize these ourselves on the back-end.</p> <p>Is this the right way of doing it?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload