mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
Add paddock briefing RSS backend spike
This commit is contained in:
24
internal/store/migrations/003_news.sql
Normal file
24
internal/store/migrations/003_news.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
CREATE TABLE IF NOT EXISTS news_sources (
|
||||
source TEXT PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
feed_url TEXT NOT NULL,
|
||||
category TEXT,
|
||||
enabled INTEGER NOT NULL DEFAULT 1,
|
||||
fetched_at INTEGER,
|
||||
expires_at INTEGER,
|
||||
updated_at INTEGER NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS news_items (
|
||||
url TEXT PRIMARY KEY,
|
||||
source TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
published_at INTEGER,
|
||||
summary TEXT,
|
||||
category TEXT,
|
||||
fetched_at INTEGER NOT NULL,
|
||||
FOREIGN KEY (source) REFERENCES news_sources(source)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_news_items_published ON news_items (published_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_news_items_source_published ON news_items (source, published_at DESC);
|
||||
Reference in New Issue
Block a user