Schema audit, November 2026
A review of goatboat's database on 30 November 2026: what the schema says, what the rows actually hold, and the migration I'd run.
A review of goatboat's database as it stood on 30 November 2026: what the schema says, what the rows actually hold, and what I'd change.
It was written by an AI assistant at Jay's request, from three sources: read-only queries against the live database, src/db/schema.ts, and the code that reads and writes the tables. Nothing was changed.
The short version
The data is clean. Every integrity check passed. The problems are of a different kind: the schema describes more than the site uses, and a few facts are kept in the wrong place.
The larger design questions are at the end: projects being stored twice, the "unfiled" project, and what thousands of games would need. Those need answers from Jay before any schema work.
What's in the database
The whole file is 2.15 MB. Of the 221 content rows, 164 are stored in the database and 57 are code pages reported by the site.
What's healthy
Each of these was checked and came back with nothing wrong:
- Links between tables. Foreign keys are enforced, with no violations.
- Paths. Every page's path equals its parent's path plus its slug, and every slug is lowercase letters, digits and hyphens.
- Dates. Every timestamp is in the one ISO format, every published row has a publish date, and none is dated in the future.
- Lists. Every
tags,authorsandtocvalue is a valid list. - Content rules kept in code. Every link has its link row, every published artifact has its HTML file and a thumbnail, and every page's section belongs to that page's project.
- Notes. All 128 notes have a project and a section.
- The live tables match
schema.ts. Six migrations are applied and no stray tables or indexes exist.
Findings
1. Columns and values nothing uses
Three columns are nearly empty but should stay, because the site is already built to show them:
revised_at(0 rows) is shown as "Updated" in a page's byline.authorship_note(0 rows) is shown in the byline's popover.authors(3 rows) falls back to Jay when empty.
2. A default that states a fact
All 221 content rows say ai-assisted. That includes the 57 code pages, the 24 artifacts and the 7 draft posts. In the whole proposal history, authorship was set on purpose once.
The value is the column's default, so it says nothing about how any page was written. The site still prints it in every article's byline, next to copy that says posts are hand-written.
The new stage column has the same trap. With a default of active, all 21 projects would read as Active on the day of the migration, whatever their real state.
A default is safe when it's a starting state, like status = draft. It isn't safe when it's a claim about the thing.
authorship: allow it to be empty, meaning "not stated", and have the site show no label for an empty one.stage: have the migration set each existing project's stage from a list Jay fills in. New projects can start asactive, since a project is usually created when work starts.
What the existing 221 rows should say is Jay's decision. I can't tell from the data.
3. kind on projects
Every project is a project; nothing is an experiment. An experiment has the same fields as a project, so the database gains nothing from telling them apart. What the label tried to say is now covered by stage, and prominence is already the manual sort order.
Dropping it is agreed. It goes in the same migration as stage.
4. Project images nobody reads
Thirty-four of the 53 project assets are shown nowhere. Eight addresses are stored more than once, as the same picture under two or three roles of one project.
The two halves of the table are also kept to different standards:
No gallery asset has an order set, so a gallery's order is whatever order the rows were added in.
This is a decision before it's a cleanup: either project pages will show galleries, logos and heroes, in which case these rows need alt text and sizes, or they won't, and the 34 rows can go.
5. Projects are stored twice
Each project is a row in projects, and also two rows in content: its home page at /projects/<slug> and its notes page at /projects/<slug>/notes. That is 40 content rows with no body and no tags.
They were made so a project's notes had somewhere to live. Since then the notes moved to /notes/<slug>: 127 notes are there, and only 2 pages remain below any project's notes page. The site builds both project pages from the project record, not from these rows.
Two facts are held in both places:
- Title. Copied to the home page row and kept in step when a project is renamed. No mismatches today.
- Status. Not kept in step. Each of the 4 private projects has a published home page row. They stay hidden only because every query also checks the project's status.
Removing the rows would touch breadcrumbs, the page tree and redirects, so it isn't part of this migration. It is the largest duplication in the schema, and worth a decision.
6. The "unfiled" project
One row in projects isn't a project. unfiled exists so that every note has a project and a section, which lets the notes sidebar always show something. Ten projects also carry an unfiled section, holding 22 pages between them.
The cost is special cases in code: this row can't be renamed, deleted or unpublished, it's filtered out of every project list, and the API marks it so the site can treat it differently. An empty project_id would say the same thing.
It works, and it was a deliberate choice. I'm listing it because "everything is a project" is not quite true of the table.
7. Tags
Two thirds of content tags appear on a single page, so they group nothing. Eight pairs are the same tag spelled two ways:
nextjs and next-js, workflow and workflows, vibecoding and vibe-coding, schema and schemas, opinion and opinions, content-system and content-systems, format and formats, structured-output and structured-outputs.
The first pair is the costly one: 9 pages have one spelling and 8 have the other, so a reader following either tag sees half.
Some tags are switches, not topics:
showcasedecides whether a page appears in the home feed. The rule is written into a goatboat query.browser-gamesdecides what appears on/games. The rule is written into the site.wipon five projects is a hand-kept stage.
Recommendations:
- Merge the eight pairs through ordinary proposals. No migration.
- Remove
wiponcestageexists. - Keep tags as lists for now. A separate tags table would not make anything faster at this size. Its real benefit is one place to rename a tag or describe it, which matters when tags get their own pages.
8. Three things decide whether a page is public
A row is public when its status is published, its project (if it has one) is published, and it isn't a code page whose file has gone missing. Nine published rows sit in private projects today, including the four home pages from finding 5.
Each query has to remember all three, and the site checks again. I read the one endpoint that needs no token, the artifact lookup, and it does check the project's status.
Nothing is leaking. The risk is in the future: any new query or endpoint that forgets one of the three would show a private project's pages. No schema change follows from this; it's the rule to keep in mind when adding a way to read content.
9. A note is a place, not a type
128 of the 221 rows are notes, and their type is page. Code recognises a note by its path starting with /notes/. Posts, links and artifacts each have their own type and also their own folder.
So "what kind of thing is this" is answered by path for notes and by type for everything else. It works. It would matter if a note should ever live outside /notes/, or if posts and notes need different fields.
10. Proposals are the history
- Size. Proposals are 36% of the database file, more than all page bodies together (649 KB). The largest single proposal is 323 KB, because an operation stores the whole body it proposed.
- Growth. That is six weeks of use. At this rate it's a few megabytes a year, which is not a problem.
- It contradicts a stated principle. The principles say "no audit log; git is history". In practice this table is the audit log, and the only record of what a page used to say.
- Old shapes stay in it. Past operations keep the field names of their day. Forty-six of them set
format, and a few setkind. Once those fields are removed, goatboat's review screens still have to open the old proposals. - Test data. Eleven proposals from 21 October carry seed-style author names (
writer-bot,tagger-botand similar).
No schema change needed. Two things to do: check that old proposals still open after the migration, and delete the eleven test rows if a clean history matters.
11. Redirects
There are 237 redirects for 221 pages. All but one were made in November, when notes moved out from under /projects, /tests and /docs. Of the 116 pages that have any, 28 have three or four.
They cost nothing and none shadows a live page. Leave them.
12. One rule that could move into the database
A code page must have a file, and source must be db or approute. Both are checked only in code. A comment in the schema explains why: adding the check would rebuild the content table.
This migration rebuilds that table anyway, so the check can be added for free. Every current row already passes.
13. Sections
Thirteen of the 37 sections hold no pages. The default readme section exists in four projects and has never held a page in any of them.
The default list is a constant in code, not part of the schema. Dropping readme from it is a one-line change, if Jay agrees it isn't used.
14. The schema docs describe a different database
SCHEMA.md was written before the first tables were created and still reads that way:
- It says a slug is unique across all content. Slugs are now unique within a parent, and the path is the unique address.
- It lists three content types and leaves out
pageandartifact. - It doesn't mention
parent_id,path,intro,toc,source,file,missing_sinceorsection_id, or thesections,proposalsandredirectstables. - It tells the reader to run
db:push, which the project now forbids. - It plans a
content_artifactstable holding HTML. Artifacts were built as assets instead.
schema.dbml has drifted the same way, and docs/data-layer.md is already marked outdated. An agent or a person reading these will get the wrong picture. Rewrite SCHEMA.md from schema.ts, or delete the two files and let schema.ts be the reference.
The migration I'd run
One migration, as Jay chose, run at the moment the new goatboat code is deployed.
Changes to projects
- Add
stage:active,complete,benchedorshelved. Required. Each existing project's value is set in the migration. - Drop
kindand its check. - Drop
video_url. - Drop
demo_urlandicontoo, if Jay decides against them.
Changes to content
- Drop
content_hash. - Drop
formatandcomponent_key, with their two checks. - Remove
imagefrom the allowed types. - Add the check that
sourceisdborapproute, and that a code page has afile. - Let
authorshipbe empty and remove its default, if Jay agrees with finding 2.
What makes it risky
SQLite can't change a check or drop a checked column in place. The migration builds a new copy of each table, copies the rows across, and swaps them.
Both tables have others pointing at them. If links between tables were being enforced during the swap, deleting the old projects table would delete every section and project image and strip the project from every page. Deleting the old content table would delete every asset, link row and redirect.
The generated migration switches enforcement off for the swap. Migration 0005 rebuilt content and assets the same way and the data survived. It still has to be proved for this one before it runs.
Before running it
- Take a copy of the database.
- Apply the migration to a copy, using the same approach as
scratch/migration-check.mts: count the rows in every table before and after, and check for broken links afterwards. - Open a few old proposals in goatboat against the copy, to confirm the review screens cope with the removed fields.
Order
- Deploy a version of the site that no longer reads
kind. It's read in one place, a badge on/notes/projects. - Run the migration and deploy goatboat together. Projects will fail in production for the short time between the two.
- Ship the new projects page, grouped by stage.
Not in this migration
- Tag merges and removing
wip(ordinary proposals, after the migration). - Project image cleanup (waits on finding 4).
- Project pages, the unfiled project, and notes as a type (findings 5, 6 and 9).
Questions that would change the design
The answers decide what the schema should grow into. They're in rough order of how much each one changes.
- Games at scale. For thousands of games, what does each one need to record? Likely candidates: where it came from and who made it, its licence, whether it works on a phone, and how it sizes itself in its frame. Today an artifact has no fields of its own beyond a title, a description and two files.
- Project pages. Will a project's page show a gallery, a logo or a hero image?
- Project dates. Now that a project can be
complete, should it record when it started and finished? - Featured projects. Is the manual order enough to give bigger projects more room, or should a project be markable as featured?
- Projects inside projects.
/gamesis a project that lives inside the site, which is also a project. Does that relationship need recording? - More than one project. Can a note belong to two projects?
- Tag pages. Should a tag have its own page with a description?
- Private or unlisted. Should
privatemean "only Jay", or "reachable by link but not listed"? The site treatsdraftandprivatethe same today. - Posts. All seven posts are drafts. How should a post differ from a note in the data, beyond its folder?
- Page history. Is the proposal history enough, or should a page keep its earlier versions?
- Scheduled publishing. Should a future publish date mean "publish then"?
- The older designs. Quotes, comments, releases and multi-file code blocks were designed and deferred. Are any still wanted?
Related
- Architectural Blueprint: Single-File "Code-as-Data" CMS
A web-first content layer that treats fully interactive React components as flat text strings in a database, bypassing heavy bundlers while enabling rapid AI-assisted development.
- Why I'm Finally Moving to SQLite (And Why I Waited Until Now)
After over 60 articles in one month, my file-based content system is breaking down. Here's why I'm migrating to SQLite, why now, and why I didn't do this sooner.
- Block Model Architecture
Why chunking Markdown into structured blocks unlocks vector search, WYSIWYG editing, and inline search results.
- Projects Architecture
Introducing Projects as a first-class organizing concept to give docs, posts, and demos the context they need.