[schemas] Reading list with ratings and review metadata - #444
Open
kaizengrowth wants to merge 1 commit into
Open
[schemas] Reading list with ratings and review metadata#444kaizengrowth wants to merge 1 commit into
kaizengrowth wants to merge 1 commit into
Conversation
Implements the reading list planned in the schemas README (issue NateBJones-Projects#16): a standalone reading_list table for books, articles, podcasts, and videos with want_to_read/reading/finished/abandoned status, 1-5 ratings, review notes, start/finish dates, and JSONB tags. Includes CHECK constraints on type/status/rating/date ordering, five indexes for the common filters, an updated_at touch trigger, a currently_reading view, and a commented optional RLS block. Fully idempotent; does not touch the core thoughts table. Verified against Postgres 16: migration applied twice cleanly, trigger and view behave, and all four constraints reject invalid rows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16
Contribution Type
/recipes)/schemas)/dashboards)/integrations)/skills)What does this do?
Adds the reading-list schema that was listed as planned in
schemas/README.md: a standalonereading_listtable for tracking books, articles, podcasts, and videos throughwant_to_read → reading → finished(plusabandoned), with a 1–5 rating, review notes, url, start/finish dates, and JSONB tags — all the fields recommended in the issue.Beyond the table itself:
type,status,rating(1–5), and date ordering (finished_datecan't precedestarted_date)updated_attouch trigger so edits keep the timestamp freshcurrently_readingview for the shelf you check most oftenthoughtstable and thereadwise-booksschema precedent. The README explains when to enable it.The migration is fully idempotent and does not touch the core
thoughtstable. Also updatesschemas/README.md: adds the schema to the catalog table and removes the fulfilled entry from the Ideas list.Design note:
abandonedis included alongside the three statuses from the issue — DNF-ing is a real reading outcome, and adding it later would mean an ALTER for everyone. The README's troubleshooting section shows how to extend the status list if you want more (e.g.on_hold).Tested: applied against Postgres 16 twice in a row (idempotency), verified the trigger updates
updated_at, the view returns in-progress items, and all four constraint classes reject invalid rows.Requirements
No external services or tools — just the Supabase SQL Editor (or CLI) from a working Open Brain setup.
Checklist
README.mdwith prerequisites, step-by-step instructions, and expected outcomemetadata.jsonhas all required fields