summaryrefslogtreecommitdiff
path: root/internal/store/sqlite.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/store/sqlite.go')
-rw-r--r--internal/store/sqlite.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/store/sqlite.go b/internal/store/sqlite.go
index 5f58fd4..a078748 100644
--- a/internal/store/sqlite.go
+++ b/internal/store/sqlite.go
@@ -96,6 +96,11 @@ func (s *Store) SaveTasks(tasks []models.Task) error {
}
defer tx.Rollback()
+ // Clear existing tasks first to remove stale data
+ if _, err := tx.Exec(`DELETE FROM tasks`); err != nil {
+ return err
+ }
+
stmt, err := tx.Prepare(`
INSERT OR REPLACE INTO tasks
(id, content, description, project_id, project_name, due_date, priority, completed, labels, url, created_at, updated_at)