database - Create ERD for Schedule,Day,Task system - Stack Overflow

admin2025-03-28  1

I want to create the following setup (I tried to put it in simple terms, that's why it will sound silly):
Admin can create predefined Tasks: Swim, Jump, Eat, Drink, Dance.
Admin can create predefined Days that contain few tasks: Day1 has(Jump, Swim), Day2 has(Drink, Eat).
Admin can create predefined Schedules that contain some of those days: Schedule1 has(Day1, Day2, Day3), Schedule2 has(Day13, Day23, Day53).


Each Schedule is set for a period of time, example if schedule is made up of 2 days, and is set to start on 1/1/2025 and end on 20/1/2025, user with assigned schedule is supposed to go through the days one by one and repeat them in order on his work days until he reaches 1/2/2025.


The idea of predefined on those entities, so that eventually admins can be able to build complex schedules from predefined days without having to build everything from scratch, maybe reassign schedules again to users...etc.

Now here's the issue I am having with all ERD setups I tried to make: User with assigned Schedule need to have the ability to leave comments on instances of Days, Tasks or Schedules, and admin to reply to those comments. example: user1 comments "I didn't like Swimming on day 1 in schedule 3, it was cold". user1 then comments "I liked swimming on day 3 in schedule 7, it was a hot day".

Please note that those comments entities are needed to have relationships and it's not a simple string, I wanna have a reference to the Task, Day or schedule. which is duplicated and could be assigned to multiple users, but to have the erd built in a way where the comment only appears on that instance of Task-Day-Schedule for that assigned user.

Basic ERD I build to kinda explain the situation.
ERD Image

转载请注明原文地址:http://anycun.com/QandA/1743139774a64724.html