KevinM1 Posted March 17, 2010 Share Posted March 17, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/195592-db-design-question/ Share on other sites More sharing options...
premiso Posted March 17, 2010 Share Posted March 17, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/195592-db-design-question/#findComment-1027740 Share on other sites More sharing options...
KevinM1 Posted March 17, 2010 Author Share Posted March 17, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/195592-db-design-question/#findComment-1027747 Share on other sites More sharing options...
premiso Posted March 17, 2010 Share Posted March 17, 2010 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... Quote Link to comment https://forums.phpfreaks.com/topic/195592-db-design-question/#findComment-1027752 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.