Files
ReadMeABook/prisma/migrations/20260130000000_add_ebook_request_fields/migration.sql
T
kikootwo 590f089733 Add first-class ebook request support and UI
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.
2026-01-30 15:59:25 -05:00

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 $$;