I have the following tables structure for my database:
users
event_user
events
event_user_histories
event_user_reviews
locations
My business rules are:
- User can select and join many events, and an event can be joined by many users.
- User will need to pick an event and a location to participate in the event. The
event_id
,location_id
,user_id
,status
, related data etc. will be stored inevent_user
. And this table will has primary key to link withevent_user_histories
andevent_user_reviews
. - After that, user will need to submit review content and waiting to be approved, which the data will be stored in
event_user_reviews
. - There will be status change record in
event_user_histories
when user submit the review content, status likecontent submitted
,pending for review
,review in progress
, etc.
May I know am I doing correctly for my database design, or any suggestions to simplify it? Any advice would be appreciated.
CodePudding user response:
I think you not need event_user_histories
and event_user_reviews
You can store review content and status to event_user
table. Because 1 user and 1 event have only 1 record
CodePudding user response:
I think you can re-arange your tables in this order so that the User, Event and Locations will be as parrent tables to be accessible by those tables that needs the foreignKeys!
users
events
locations
event_user
event_user_histories
event_user_reviews