bluesky viewer in the terminal
1CREATE TABLE IF NOT EXISTS posts (
2 id TEXT PRIMARY KEY,
3 created_at DATETIME NOT NULL,
4 updated_at DATETIME NOT NULL,
5 uri TEXT NOT NULL UNIQUE,
6 author_did TEXT NOT NULL,
7 text TEXT NOT NULL,
8 feed_id TEXT NOT NULL,
9 indexed_at DATETIME NOT NULL,
10 FOREIGN KEY (feed_id) REFERENCES feeds(id) ON DELETE CASCADE
11);
12
13CREATE INDEX IF NOT EXISTS idx_posts_feed_id ON posts(feed_id);
14CREATE INDEX IF NOT EXISTS idx_posts_author_did ON posts(author_did);
15CREATE INDEX IF NOT EXISTS idx_posts_indexed_at ON posts(indexed_at DESC);
16CREATE INDEX IF NOT EXISTS idx_posts_uri ON posts(uri);