feat(bookmarks): api+store — per-user CRUD, owner-scoped 404, percent-ordered list
This commit is contained in:
@@ -19,3 +19,11 @@ CREATE TABLE IF NOT EXISTS reading_progress (
|
||||
locator JSONB NOT NULL DEFAULT '{}', percent DOUBLE PRECISION NOT NULL DEFAULT 0,
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (user_id, library_id, book_path));
|
||||
CREATE TABLE IF NOT EXISTS bookmarks (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
library_id BIGINT NOT NULL, book_path TEXT NOT NULL,
|
||||
locator JSONB NOT NULL, percent DOUBLE PRECISION NOT NULL DEFAULT 0,
|
||||
note TEXT NOT NULL DEFAULT '',
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now());
|
||||
CREATE INDEX IF NOT EXISTS bookmarks_user_book_idx ON bookmarks (user_id, library_id, book_path);
|
||||
|
||||
Reference in New Issue
Block a user