View Single Post
Old 12-11-2007, 04:41 PM   #12 (permalink)
bdm
The Acquainted
Good Samaritan 
 
Join Date: Nov 2007
Posts: 127
Thanks: 14
bdm is on a distinguished road
Default

You're model seems incomplete. You have a users table, but no username, fullname, password, etc.

Also, you'll want a one-to-many relationship between your tutorials and comments table. With the way you have things set up, it seems like each tutorial can only have one comment. I would probably make a bridge table between the tutorials and comments table.

Tutorials
- id (PK)
- title
|
|
Tutorials_Comments_Bridge
tutorial_id
comment_id
|
|
Comments
- id (PK)
- user_id
- text
Same would go for your recipes table.

And I'm getting confused with the tutorials table. You have category_ID and tutorial_category_ID. Same with your comments table. I also don't think the category_ID is needed in your comments table since you would be getting the category name from the tutorials table when you join the two.

That way, you could have as many comments per tutorial as you wish. All you would have to do is join both table and easily get all comments for tutorial_id n.

Although, I would like to get a second opinion.

Thanks.
bdm is offline  
Reply With Quote