I have a recurring event schema that has a RecurrenceType and a RecurrenceMultiple column. The RecurrenceType is a foreign key to a table that has these options (1) No Recurrence (2) Daily (3) Weekly (4) Monthly. RecurrenceMultiple is an integer that indicates what multiple of the recurring time frame each event occurs. a few examples
- RecurrenceType=1, RecurrenceMultiple=1 : One time only
- RecurrenceType=2, RecurrenceMultiple=1 : Every day
- RecurrenceType=3, RecurrenceMultiple=1 : Every week
- RecurrenceType=3, RecurrenceMultiple=2 : Every other week
- RecurrenceType=4, RecurrenceMultiple=1 : Every month
- RecurrenceType=4, RecurrenceMultiple=3 : Every 3rd month
- RecurrenceType=4, RecurrenceMultiple=12 : Yearly
I'd like to somehow combine these two columns in a way that I can infer the RecurrenceType allowing me to ditch the lookup table. I can't think of a good way to do this though and avoid collisions.
This is the approach I've decided to use
A single column
RecurrenceFrequencycan be used if it's assumed that 0 means no recurrence, positive values mean a timespan of X days and negative values mean a timespan of X months