Skip to content

Commit

Permalink
sqlite: Enforce that occurences in calendarobjects are processable by…
Browse files Browse the repository at this point in the history
… date()
  • Loading branch information
lennart-k committed Jan 22, 2025
1 parent c557f6d commit 69947d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/store_sqlite/src/calendar_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl SqliteCalendarStore {

(if overwrite {
sqlx::query!(
"REPLACE INTO calendarobjects (principal, cal_id, id, ics, first_occurence, last_occurence, etag, object_type) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
"REPLACE INTO calendarobjects (principal, cal_id, id, ics, first_occurence, last_occurence, etag, object_type) VALUES (?, ?, ?, ?, date(?), date(?), ?, ?)",
principal,
cal_id,
object_id,
Expand All @@ -350,7 +350,7 @@ impl SqliteCalendarStore {
} else {
// If the object already exists a database error is thrown and handled in error.rs
sqlx::query!(
"INSERT INTO calendarobjects (principal, cal_id, id, ics, first_occurence, last_occurence, etag, object_type) VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
"INSERT INTO calendarobjects (principal, cal_id, id, ics, first_occurence, last_occurence, etag, object_type) VALUES (?, ?, ?, ?, date(?), date(?), ?, ?)",
principal,
cal_id,
object_id,
Expand Down

0 comments on commit 69947d5

Please sign in to comment.