1

Below is a preview of the type of list I am talking about.

enter image description here

What is going to happen is each user is going to have their own list that they can create. They will be able to modify the headings (Maintenance, Tire Services) and modify each item and add to it and add more rows.

Here is a database design I had in mind:

titles: id - name - user_id

  • 1 - Maintenance - 1
  • 2 - Tire Services - 1

services: id - title_id - name - user_id

  • 1 - 1 - Wiper Blades - 1
  • 2 - 1 - Cooling System - 1
  • 3 - 2 - Tire Rotation - 1
  • 4 - 2 - Wheel Balance - 1

Is that a decent schema? I tried to keep it to 1 table and just have a "type" field for either "title" or "service" but then realized if it was a service, I didn't know how to specify which title it was supposed to be under.

Just trying to learn how to do things the right way and was wondering what you guys would do in this situation and if this is a good idea?

Thanks!

Drew
  • 6,736
  • 17
  • 64
  • 96

1 Answers1

3

Based on my assumptions of what you are trying to achieve, you will not need a user_id in services as you can get that from the related title.

smp7d
  • 4,947
  • 2
  • 26
  • 48