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.

#RecommendationKind of change
1Add stage to projects and drop kindMigration
2Drop four columns and one content type that nothing usesMigration
3Stop a default from stating a fact (authorship)Migration, after a decision
4Move one rule about code pages into the databaseMigration
5Merge near-duplicate tags and retire wipData cleanup
6Decide what project images are forDecision
7Rewrite or delete the schema docsDocs

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

TableRowsWhat they are
content221189 pages, 24 artifacts, 7 posts, 1 link
projects2120 projects and the "unfiled" catch-all
sections37Notes sections, one set per project
assets10249 on content, 53 on projects
content_links1The extra fields of the one link
redirects237Old paths of moved pages
proposals190Every proposed change, with 1,161 operations

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, authors and toc value 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

Column or valueRows using itWhat I foundRecommendation
content.content_hash0 of 221No code writes it. The schema doc already says to drop it unless a sync tool needs one.Drop
content.formatAll 221 are mdmdx and component were never used. Code pages ended up as source = approute with a file, which replaced the component idea. Nothing reads the column.Drop, with its check
content.component_key0 of 221Only means something with format = component.Drop, with its check
Content type image0 rowsWhat an image post is was never defined.Remove from the list until it's designed
projects.kindAll projectSee finding 3.Drop
projects.video_url0 of 21The two projects with videos hold them as gallery assets instead.Drop
projects.demo_url1 of 21The site shows it as "Demo" beside "Visit".Decide: keep, or move the one value to app_href and drop
projects.icon20 of 21Filled in, but neither the site nor goatboat shows it anywhere. The names aren't consistent either (trendingUp beside gamepad2).Decide: show it, or drop

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 as active, 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

RoleRowsRead by the site
Thumbnail19Yes
Gallery22 (20 images, 2 videos)No
Logo7No
Hero5No

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:

Missing alt textMissing width or height
Content images (25)00
Project images and videos (53)4935

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

Distinct tagsUsesUsed once
Content257702165
Projects466436

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:

  • showcase decides whether a page appears in the home feed. The rule is written into a goatboat query.
  • browser-games decides what appears on /games. The rule is written into the site.
  • wip on five projects is a hand-kept stage.

Recommendations:

  • Merge the eight pairs through ordinary proposals. No migration.
  • Remove wip once stage exists.
  • 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

ProposalsOperationsSize
Approved1701,002749 KB
Rejected2015926 KB
  • 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 set kind. 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-bot and 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 page and artifact.
  • It doesn't mention parent_id, path, intro, toc, source, file, missing_since or section_id, or the sections, proposals and redirects tables.
  • It tells the reader to run db:push, which the project now forbids.
  • It plans a content_artifacts table 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, benched or shelved. Required. Each existing project's value is set in the migration.
  • Drop kind and its check.
  • Drop video_url.
  • Drop demo_url and icon too, if Jay decides against them.

Changes to content

  • Drop content_hash.
  • Drop format and component_key, with their two checks.
  • Remove image from the allowed types.
  • Add the check that source is db or approute, and that a code page has a file.
  • Let authorship be 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

  1. Take a copy of the database.
  2. 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.
  3. Open a few old proposals in goatboat against the copy, to confirm the review screens cope with the removed fields.

Order

  1. Deploy a version of the site that no longer reads kind. It's read in one place, a badge on /notes/projects.
  2. Run the migration and deploy goatboat together. Projects will fail in production for the short time between the two.
  3. 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.

  1. 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.
  2. Project pages. Will a project's page show a gallery, a logo or a hero image?
  3. Project dates. Now that a project can be complete, should it record when it started and finished?
  4. Featured projects. Is the manual order enough to give bigger projects more room, or should a project be markable as featured?
  5. Projects inside projects. /games is a project that lives inside the site, which is also a project. Does that relationship need recording?
  6. More than one project. Can a note belong to two projects?
  7. Tag pages. Should a tag have its own page with a description?
  8. Private or unlisted. Should private mean "only Jay", or "reachable by link but not listed"? The site treats draft and private the same today.
  9. Posts. All seven posts are drafts. How should a post differ from a note in the data, beyond its folder?
  10. Page history. Is the proposal history enough, or should a page keep its earlier versions?
  11. Scheduled publishing. Should a future publish date mean "publish then"?
  12. The older designs. Quotes, comments, releases and multi-file code blocks were designed and deferred. Are any still wanted?