-- One row per tracked series, keyed ":". -- -- Everything is NOT NULL with a default except latest_chapter_num, where NULL -- is a distinct state: nothing has been captured yet, which is not the same as -- chapter zero. -- -- Timestamps are unix milliseconds as bigint, not timestamptz: the userscripts -- send Date.now() over the wire and the ordering rule compares them directly. CREATE TABLE bookmarks ( key text PRIMARY KEY, site text NOT NULL, series_id text NOT NULL, title text NOT NULL DEFAULT '', series_url text NOT NULL DEFAULT '', cover text NOT NULL DEFAULT '', last_chapter text NOT NULL DEFAULT '', last_chapter_num double precision NOT NULL DEFAULT 0, last_chapter_url text NOT NULL DEFAULT '', favorite boolean NOT NULL DEFAULT false, latest_chapter text NOT NULL DEFAULT '', latest_chapter_num double precision, -- When the server last polled this series, unix ms; 0 means never, and sorts -- first so a new bookmark is picked up on the next tick with no special case. latest_checked_at bigint NOT NULL DEFAULT 0, status text NOT NULL DEFAULT 'reading', kind text NOT NULL DEFAULT 'manga', updated_at bigint NOT NULL );