reading: split the book tracker into books, papers and articles (kind column + migration classifying 20 papers), segmented tabs with counts, article cards that open the link, owner + add link with server-side unfurl, kind switch on detail pages, /trackers/reading alias
All checks were successful
Deploy production / deploy (push) Successful in 1m8s
All checks were successful
Deploy production / deploy (push) Successful in 1m8s
This commit is contained in:
14
drizzle/20261025133601_reading_kinds/migration.sql
Normal file
14
drizzle/20261025133601_reading_kinds/migration.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
CREATE TYPE "books"."kind" AS ENUM('book', 'paper', 'article');--> statement-breakpoint
|
||||
ALTER TABLE "books"."works" ADD COLUMN "kind" "books"."kind" DEFAULT 'book'::"books"."kind" NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "books"."works" ADD COLUMN "url" text;--> statement-breakpoint
|
||||
ALTER TABLE "books"."works" ADD COLUMN "site_name" text;--> statement-breakpoint
|
||||
ALTER TABLE "books"."works" ADD COLUMN "published_at" timestamp with time zone;--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX "works_url_key" ON "books"."works" ("url") WHERE "url" is not null;--> statement-breakpoint
|
||||
CREATE INDEX "works_kind_idx" ON "books"."works" ("kind");--> statement-breakpoint
|
||||
-- Classify existing papers: anything with an arXiv id, or a short ISBN-less PDF from the Drive
|
||||
-- "Papers/" folder (Ilya Sutskever's list). Longer works in that folder (Kolmogorov
|
||||
-- Complexity, Machine Super Intelligence) stay books.
|
||||
UPDATE "books"."works" SET "kind" = 'paper'
|
||||
WHERE "source_refs" ? 'arxiv'
|
||||
OR ("isbn13" IS NULL AND coalesce("page_count", 0) BETWEEN 1 AND 99
|
||||
AND EXISTS (SELECT 1 FROM jsonb_array_elements_text(CASE WHEN jsonb_typeof("source_refs"->'drive') = 'array' THEN "source_refs"->'drive' ELSE '[]'::jsonb END) d WHERE d LIKE 'Papers/%'));
|
||||
Reference in New Issue
Block a user