mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 21:00:09 +00:00
590f089733
Implements first-class ebook requests with their own type, parent-child relationship to audiobook requests, and separate status flow. Updates database schema and migrations to support 'type' and 'parentRequestId' fields on requests. Adds processors and job types for ebook search and direct HTTP download from Anna's Archive, with FlareSolverr integration for Cloudflare bypass. Enhances admin UI tables and request actions to display and manage ebook requests, including orange badge and source links. Updates documentation to reflect new ebook support, configuration, and behavior.
20 lines
749 B
SQL
20 lines
749 B
SQL
-- AlterTable
|
|
ALTER TABLE "requests" ADD COLUMN IF NOT EXISTS "type" TEXT NOT NULL DEFAULT 'audiobook';
|
|
ALTER TABLE "requests" ADD COLUMN IF NOT EXISTS "parent_request_id" TEXT;
|
|
|
|
-- CreateIndex
|
|
CREATE INDEX IF NOT EXISTS "requests_type_idx" ON "requests"("type");
|
|
CREATE INDEX IF NOT EXISTS "requests_parent_request_id_idx" ON "requests"("parent_request_id");
|
|
|
|
-- AddForeignKey (with ON DELETE SET NULL)
|
|
DO $$
|
|
BEGIN
|
|
IF NOT EXISTS (
|
|
SELECT 1 FROM pg_constraint
|
|
WHERE conname = 'requests_parent_request_id_fkey'
|
|
) THEN
|
|
ALTER TABLE "requests" ADD CONSTRAINT "requests_parent_request_id_fkey"
|
|
FOREIGN KEY ("parent_request_id") REFERENCES "requests"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
END IF;
|
|
END $$;
|