summaryrefslogtreecommitdiff
path: root/migrations/002_add_cache_metadata.sql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/002_add_cache_metadata.sql')
-rw-r--r--migrations/002_add_cache_metadata.sql17
1 files changed, 17 insertions, 0 deletions
diff --git a/migrations/002_add_cache_metadata.sql b/migrations/002_add_cache_metadata.sql
new file mode 100644
index 0000000..da6c0ce
--- /dev/null
+++ b/migrations/002_add_cache_metadata.sql
@@ -0,0 +1,17 @@
+-- Cache metadata table for tracking API fetch times and TTL
+
+CREATE TABLE IF NOT EXISTS cache_metadata (
+ key TEXT PRIMARY KEY,
+ last_fetch DATETIME NOT NULL,
+ ttl_minutes INTEGER NOT NULL DEFAULT 5,
+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
+);
+
+-- Pre-populate with cache keys
+INSERT OR IGNORE INTO cache_metadata (key, last_fetch, ttl_minutes) VALUES
+ ('todoist_tasks', '2000-01-01 00:00:00', 5),
+ ('todoist_projects', '2000-01-01 00:00:00', 5),
+ ('obsidian_notes', '2000-01-01 00:00:00', 5),
+ ('plantoeat_meals', '2000-01-01 00:00:00', 5),
+ ('trello_boards', '2000-01-01 00:00:00', 5),
+ ('trello_cards', '2000-01-01 00:00:00', 5);