Jump to content

Recommended Posts

I'm currently working on a game review site, and have hit a small snag with my db design.  A lot of games are offered on multiple platforms, for example, the Grand Theft Auto series - the main games are available on PS3, XBOX 360, and the PC.  I'm just wondering how I should model that, as right now I have a sketch that looks like:

 

table reviews(
id unsigned int not null auto-increment primary key,
title varchar(45) not null,
permalink varchar(45) not null,
content text not null,
genre_id unsigned int not null foreign key (genres)
)

 

I'm just not sure how to properly tie the platform info to the reviews.  Maybe a pivot table linking games to platforms?

Link to comment
https://forums.phpfreaks.com/topic/195592-db-design-question/
Share on other sites

table reviews(
id unsigned int not null auto-increment primary key,
title varchar(45) not null,
permalink varchar(45) not null,
content text not null,
genre_id unsigned int not null foreign key (genres)
platform_id unsigned int not null foreign key (platforms)
)

table platforms(
id auto_inc primary,
platform varchar(45)

 

Would be what I would do.

 

EDIT:

If you have a games table, that would be the spot to put the platform_id or the pivot table. Either or should work.

Link to comment
https://forums.phpfreaks.com/topic/195592-db-design-question/#findComment-1027740
Share on other sites

That's definitely an idea, but I was hoping to not have a separate review for the same game on multiple platforms.  Of course, I could always have a platforms_reviews pivot table...  hmm.

 

You would not "have" to have a review for the same game on multi-platforms. necessarily. You could if you want, but instead you could just do "Reviewed on Platform" then just do not link the reviews via category wise to a platform, if that makes sense...

Link to comment
https://forums.phpfreaks.com/topic/195592-db-design-question/#findComment-1027752
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.