zidance's avatar

Database design for event

This purpose of this app is to allow company create an event to let user to join by completing a list of task by uploading video or photo as a proof.

I have a business rule like

  1. Company can create many events.
  2. Event can consists of multiple plans.
  3. Each plan may consist of task or services to complete or promote.
  4. A user can pick a suitable plan to join.
  5. User must complete the task given and upload details for admin to verify.

So I will have table such as companies, events, event_plans, user_event, users, user_event_histories, user_event_tasks.

For user_event table, will store all relevant details to the event plan, while user_event_tasks will record all relevant details when user upload details for the task. user_event_histories will just to capture all changes happened and as a timeline history for the event.

I am seeking for advice or idea to make the design better, appreciate if any suggestion or anyone is dealing with similar structure. Thanks!

0 likes
3 replies
Tray2's avatar

I think that your design is quite good as it is. Is user_event a pivot table? In that case call it event_user to get some free help from laravel, if not make sure that it's user_events.

I would probably not have the user prefix on the user_event_histories and user_event_tasks and just call them event_histories and event_tasks

zidance's avatar

@Tray2 Ya, user_event is a pivot table to store user choose on which event with the event plan.

Sorry missed out this 2 table event_histories and event_tasks. This event_histories table is to store the status changed for the events where approval take place before publishing to user. event_tasks is just to store the to-do task for the events.

So I have another table named user_event_histories and user_event_tasks here, to specifically store data when user upload their details for the event_tasks.

Does it make sense or over complicated?

Tray2's avatar

@zidance I would probably try to go with other names for these two at least user_event_histories and user_event_tasks and then change to user_event to event_user to follow tha laravel naming convention.

Please or to participate in this conversation.