So I'm going to be doing some work for a client on storing recurring events in a database. The system (a contact management app) already stored single-occurrence events in the DB.
So I'm wondering if anybody has thought about the best way to do this. I can use DateTime::Event::ICal to ensure that I generate sets that can be passed to DateTime::Format::ICal->format_recurrence, but how do I then search on that data? For example, if I want to simple show events occuring this month, how can I pull only the relevant sets? The best implementation I've thought of is this: - store sets in a separate table - store the iCal string to define the set - store the start & end date for finite sets, but this can also be NULL for infinite sets When querying, retrieve sets where the start/end date includes the current span we're looking at, as well as all infinite sets. If a user edits a single occurence of a recurrent event, store that in the existing (non-recurring) event table, with a foreign key pointing to the relevant set, also add an exclusion to the original set. Anyone have any better ideas? -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/
