8 CREATE TABLE playlists(
12 CREATE TABLE subscriptions(
13 channel_id STRING
, -- TODO: rename so it makes sense for playlists
15 type TEXT DEFAULT 'channel' NOT NULL CHECK(type IN ('channel', 'playlist')),
16 PRIMARY KEY (channel_id
, user));
18 id STRING
PRIMARY KEY,
22 livestream
BOOLEAN DEFAULT 0,
24 crawled DATETIME
DEFAULT CURRENT_TIMESTAMP);
25 CREATE TABLE playlist_videos(
28 PRIMARY KEY (video_id
, playlist_id
));
30 channel_id STRING
PRIMARY KEY, -- TODO: rename so it makes sense for playlists
31 crawled_at DATETIME
DEFAULT CURRENT_TIMESTAMP);
33 channel_id STRING
PRIMARY KEY,
34 subscribed_until DATETIME
DEFAULT CURRENT_TIMESTAMP,
35 pending
BOOLEAN DEFAULT 0);
39 display
TEXT CHECK(display
IN (NULL, 'pinned', 'hidden')),
40 PRIMARY KEY (user, video_id
));
42 rowid INTEGER PRIMARY KEY CHECK (rowid = 0), -- limit to 1 row
51 CREATE TABLE subreddits(
52 subreddit STRING
COLLATE NOCASE
, -- e.g. videos (not /r/...)
54 PRIMARY KEY (subreddit
, user));
60 CREATE TABLE captcha_requests(
64 timestamp DATETIME
DEFAULT CURRENT_TIMESTAMP);
65 CREATE TABLE captcha_cookies(
74 id INTEGER PRIMARY KEY AUTOINCREMENT
,
76 password TEXT NOT NULL,
77 token TEXT NOT NULL); -- TODO: deprecated; use users.id instead
78 CREATE TABLE user_tokens( -- stores revocable url tokens for feeds.
79 user_id
INTEGER PRIMARY KEY NOT NULL,