sqlite_store: Drop timezone column in favour of timezone_id

This commit is contained in:
Lennart
2025-07-25 23:01:51 +02:00
parent 1ba9a97b3f
commit a22235d976
5 changed files with 36 additions and 32 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE calendars ADD COLUMN timezone TEXT;

View File

@@ -0,0 +1,3 @@
-- We don't want to save timezones as ics anymore
-- but instead just rely on the TZDB identifier
ALTER TABLE calendars DROP COLUMN timezone;

View File

@@ -98,7 +98,7 @@ impl SqliteCalendarStore {
) -> Result<Calendar, Error> {
let cal = sqlx::query_as!(
CalendarRow,
r#"SELECT principal, id, displayname, "order", description, color, timezone_id, deleted_at, synctoken, subscription_url, push_topic, comp_event, comp_todo, comp_journal
r#"SELECT *
FROM calendars
WHERE (principal, id) = (?, ?)
AND ((deleted_at IS NULL) OR ?) "#,
@@ -118,7 +118,7 @@ impl SqliteCalendarStore {
) -> Result<Vec<Calendar>, Error> {
let cals = sqlx::query_as!(
CalendarRow,
r#"SELECT principal, id, displayname, "order", description, color, timezone_id, deleted_at, synctoken, subscription_url, push_topic, comp_event, comp_todo, comp_journal
r#"SELECT *
FROM calendars
WHERE principal = ? AND deleted_at IS NULL"#,
principal