So here is my current Database Project. General idea of relations:
- User can make many Points, Hints and Games, but all of them belong to one User.
- Points can have many Hints while Hint can belong to only one Point.
- Game can have many Hints(on image its Games_Points table, but idea is one game can use set of unique Points).
- The problematic stuff starts on Game relation with Users. Game can be created by one User however multiple Users should be able to join Game. My approach was to create many to many tables - Users_Games (its job was for User to show statistic in games he is participating and for Game to know which User is taking part in it)
- there is Games_Points_Users table for checking if User taking part in Game has reached a Point.
For additional info for last 3 mentioned tables (Users_Games, Games_Points, Games_Points_Users) I am using composite keys as primary key.
I have feeling that this design logic is flawed. Do I need to normalize my database a little more? Will I be able to make those relations work with Eloquent? Maybe I should create additional table Players which will be subtype of Users?
Aucun commentaire:
Enregistrer un commentaire