-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalendarEvents.sql
More file actions
348 lines (319 loc) · 6.74 KB
/
CalendarEvents.sql
File metadata and controls
348 lines (319 loc) · 6.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
CREATE TABLE calendar_events (
Id BIGINT UNSIGNED AUTO_INCREMENT,
UserId VARCHAR(255) NULL, -- NULL = public event
Title VARCHAR(255) NOT NULL,
Description TEXT NULL,
StartDate DATETIME NOT NULL,
EndDate DATETIME NOT NULL,
IsAllDay BOOLEAN NOT NULL DEFAULT FALSE,
RRule TEXT NULL, -- recurrence rule
RDate TEXT NULL, -- optional included dates
ExDate TEXT NULL, -- optional excluded dates
CreatedAt DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
UpdatedAt DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
INDEX idx_user (UserId),
INDEX idx_start (StartDate),
INDEX idx_user_start (UserId, StartDate),
PRIMARY KEY (`Id`)
);
/*Federal Holidays RRule's inserted via web server command line*/
/*New Year's Day*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'New Year''s Day',
'2025-01-01 00:00:00',
'2025-01-01 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1'
);
/*Martin Luther King Jr. Day*/
/*3rd Monday in January*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Martin Luther King Jr. Day',
'2025-01-20 00:00:00',
'2025-01-20 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=1;BYDAY=MO;BYSETPOS=3'
);
/*Washington's Birthday*/
/*3rd Monday in February*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Washington''s Birthday',
'2025-02-17 00:00:00',
'2025-02-17 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=2;BYDAY=MO;BYSETPOS=3'
);
/*Memorial Day*/
/*Last Monday in May*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Memorial Day',
'2025-05-26 00:00:00',
'2025-05-26 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=5;BYDAY=MO;BYSETPOS=-1'
);
/*Juneteenth*/
/*June 19*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Juneteenth National Independence Day',
'2025-06-19 00:00:00',
'2025-06-19 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=6;BYMONTHDAY=19'
);
/*Independence Day*/
/*July 4*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Independence Day',
'2025-07-04 00:00:00',
'2025-07-04 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=7;BYMONTHDAY=4'
);
/*Labor Day*/
/*1st Monday in September*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Labor Day',
'2025-09-01 00:00:00',
'2025-09-01 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=9;BYDAY=MO;BYSETPOS=1'
);
/*Columbus Day*/
/*2nd Monday in October*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Columbus Day',
'2025-10-13 00:00:00',
'2025-10-13 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=10;BYDAY=MO;BYSETPOS=2'
);
/*Veterans Day*/
/*November 11*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Veterans Day',
'2025-11-11 00:00:00',
'2025-11-11 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=11;BYMONTHDAY=11'
);
/*Thanksgiving Day*/
/*4th Thursday in November*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Thanksgiving Day',
'2025-11-27 00:00:00',
'2025-11-27 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=11;BYDAY=TH;BYSETPOS=4'
);
/*Christmas Eve*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Christmas Eve',
'2025-12-24 00:00:00',
'2025-12-24 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=24'
);
/*Christmas Day*/
/*December 25*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Christmas Day',
'2025-12-25 00:00:00',
'2025-12-25 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=25'
);
/*New Year's Eve*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'New Year''s Eve',
'2025-12-31 00:00:00',
'2025-12-31 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=31'
);
/*Pearl Harbor Remembrance Day*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Pearl Harbor Remembrance Day',
'2025-12-07 00:00:00',
'2025-12-07 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=12;BYMONTHDAY=7'
);
/*Patriot Day (September 11)*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Patriot Day',
'2025-09-11 00:00:00',
'2025-09-11 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=9;BYMONTHDAY=11'
);
/*Valentine's Day*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Valentine''s Day',
'2025-02-14 00:00:00',
'2025-02-14 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=14'
);
/*St. Patrick's Day*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'St. Patrick''s Day',
'2025-03-17 00:00:00',
'2025-03-17 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=3;BYMONTHDAY=17'
);
/*Mother's Day*/
/*2nd Sunday in May*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Mother''s Day',
'2025-05-11 00:00:00',
'2025-05-11 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=5;BYDAY=SU;BYSETPOS=2'
);
/*Father's Day*/
/*3rd Sunday in June*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Father''s Day',
'2025-06-15 00:00:00',
'2025-06-15 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=6;BYDAY=SU;BYSETPOS=3'
);
/*Halloween*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Halloween',
'2025-10-31 00:00:00',
'2025-10-31 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=10;BYMONTHDAY=31'
);
/*Cinco de Mayo*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Cinco de Mayo',
'2025-05-05 00:00:00',
'2025-05-05 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=5;BYMONTHDAY=5'
);
/*April Fool''s Day*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'April Fool''s Day',
'2025-04-01 00:00:00',
'2025-04-01 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=4;BYMONTHDAY=1'
);
/*Earth Day*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Earth Day',
'2025-04-22 00:00:00',
'2025-04-22 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=4;BYMONTHDAY=22'
);
/*Flag Day*/
INSERT INTO calendar_events
(UserId, Title, StartDate, EndDate, IsAllDay, RRule)
VALUES
(
NULL,
'Flag Day',
'2025-06-14 00:00:00',
'2025-06-14 23:59:59',
1,
'FREQ=YEARLY;BYMONTH=6;BYMONTHDAY=14'
);