I'm looking for the best practice for designing a database schema where someone can post a template of something (for example how a certain 'schedule' looks like) and then user can 'join' that template but change stuff from it without of course changing the original template.
I'll add an example, as i'm not the best in explaining something in text form. (and english is not my native language)
Say you have 4 tables:
- Schedule
- Day
- Task
- TaskRule
A schedule can have N days, a day can have N tasks, and a task finally can have N taskRules. A user will 'join' this schedule via a join table (user_schedule that has the user id and the schedule_id).
Now the problem is that when a user changes something from the template (lets say he adds a few taskRules or he removes a task) the schedule will change for everyone that is connected to it.
My question is what is the best practice to handle this? I really can't see how this can be done other then row duplication which is not my favorite thing to do.
Edit: This schema means he will join the template schedule and choose 1 of 2 things (namely to change it or not to change it, if he doesn't change it duplication is clearly redundant)