Maintaining flexibility and avoiding redundancy in recurring events DB tables

158 Views Asked by At

In my database, I have two tables that are dedicated to handling recurring events.

An 'Events' table currently store names, descriptions, locations, start time and end time of events.

the Events table

Another table, 'Episodes', takes the parent Event id as foreign key and stores event dates which are generated based on recurrency rules set with the PHP recursion library When. Recurrency logic and creation of all events-related database items is intended to happen in an Add/Edit/Delete-type interface.

the Episodes table

This database structure follows what I consider a good suggestion from a forum thread on Devshed (the 6th post). My problem is that while this as far as I can understand allow the changing of date in single Episodes easily, the same is not the case if the user wants to change start and end times to a single Episode.

I want users to be able to easily modify the start and end time of all Episodes of an Event through a button in the UI, but at the same time be able to edit the start time and end time of single Episodes of an Event by clicking the event in a calendar, while also avoiding redundant start_time and end_time fields in the database. As I am relatively inexperienced with such issues in MySQL, some suggestions would be most welcome.

0

There are 0 best solutions below