I want to store in MySQL a series of simple (never infinite) repeating appointments.
Example an appointment starts at date/time 21 JUL 2020 0900 -> end date/time 25 JUL 2020 0930. This equates to 5 appointments :
21 JUL 0900-0930
22 JUL 0900-0930
23 JUL 0900-0930
24 JUL 0900-0930
25 JUL 0900-0930
I do not think storing it the way I have outlined: with start/end dates and times is correct.
Similar question here makes me think I should structure it like this table:
ID event_id meta_key metavalue
1 1 event_start 1596445200 - 9AM MON 3 AUG 2020
2 1 event_duratn 1800 (int?) - 30 minutes
3 1 event_interval 86400 (int?)- 24 hours
4 1 event_repeat 3 (int?) - repeat 3 times
5 2 event_start 1596475200 - 9AM MON 10 AUG 2020
6 2 event_duratn 1800 - 30 minutes
7 2 event_interval 86400 - 24 hours
8 2 event_repeat 0 - do not repeat, only do it once
9 3 next event.......
Or like this:
ID event_id event_start event_duratn event_interval event_repeat
1 5 1596445200 1800 86400 3
2 3 1596475200 1800 172800 2
Which is the correct way to store this sort of repeating temporal data?