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
));
46 CREATE TABLE subreddits(
47 subreddit STRING
COLLATE NOCASE
, -- e.g. videos (not /r/...)
49 PRIMARY KEY (subreddit
, user));
55 CREATE TABLE captcha_requests(
59 timestamp DATETIME
DEFAULT CURRENT_TIMESTAMP);
60 CREATE TABLE captcha_cookies(
69 id INTEGER PRIMARY KEY AUTOINCREMENT
,
71 password TEXT NOT NULL,
72 token TEXT NOT NULL); -- TODO: deprecated; use users.id instead
73 CREATE TABLE user_tokens( -- stores revocable url tokens for feeds.
74 user_id
INTEGER PRIMARY KEY NOT NULL,