feat(db): add schema for bookmarks and meta tables

This commit is contained in:
Prad Nukala
2026-06-29 13:32:42 -04:00
parent d8df85982e
commit 861e02e72b
+20
View File
@@ -0,0 +1,20 @@
-- Bookmarks store. Rows accumulate so the feed keeps tweets even after they
-- scroll out of X's 100-item bookmarks API window.
CREATE TABLE IF NOT EXISTS bookmarks (
id TEXT PRIMARY KEY, -- tweet id
text TEXT NOT NULL,
author_id TEXT,
username TEXT,
name TEXT,
created_at TEXT, -- ISO 8601 from X
media_urls TEXT, -- JSON array of media URLs
url TEXT, -- permalink
fetched_at INTEGER NOT NULL -- epoch ms when first stored
);
CREATE INDEX IF NOT EXISTS idx_bookmarks_created ON bookmarks(created_at DESC);
-- Tiny key/value table for OAuth tokens, user id, PKCE verifiers, and last_sync.
CREATE TABLE IF NOT EXISTS meta (
key TEXT PRIMARY KEY,
value TEXT NOT NULL
);