Skip to content

feat(db): drop the unused weekends.title column - #33

Open
sdavisde wants to merge 1 commit into
claude/weekend-label-formatting-qrb0eefrom
claude/weekend-label-formatting-qrb0ee-drop-title
Open

feat(db): drop the unused weekends.title column#33
sdavisde wants to merge 1 commit into
claude/weekend-label-formatting-qrb0eefrom
claude/weekend-label-formatting-qrb0ee-drop-title

Conversation

@sdavisde

Copy link
Copy Markdown
Owner

Second of two stacked PRs — based on #32, merge that first. The diff shown here is only this PR's changes once #32 lands.

Nothing has read or written weekends.title since #32 made labels derived from weekend_groups.number and weekends.type. This removes the column and the last traces of it.

Changes

  • Migration 20260812100000_drop_weekends_title.sql
  • title removed from the Weekend domain type
  • Two queries still selecting it: the candidate move-weekend options and the user service-history join
  • The literals in supabase/seed.sql
  • database.types.ts regenerated to match

⚠️ Run these two checks against production before merging

This is the point of no return — until now the stored title has been a harmless fallback.

1. No weekend is missing a group number. A derived label depends on weekends.group_id → weekend_groups.number, and group_id is nullable. An orphan row would render as DTTD Mens with no number — worse than today, where it renders whatever text is stored. This must return zero rows:

select w.id, w.type, w.title, w.group_id, g.number
from weekends w left join weekend_groups g on g.id = w.group_id
where w.group_id is null or g.number is null;

2. No title was hand-customized. Any title edited directly in the DB to something the derived format won't reproduce is lost for good:

select id, type, title from weekends order by start_date;

Everything should read as some variant of DTTD#11, Mens DTTD#12, or DTTD Mens #42.

Note on database.types.ts

The sandbox this was authored in has no Docker, so yarn db:generate couldn't run and the types file was edited by hand — title removed from the weekends Row/Insert/Update. Please run yarn db:reset && yarn db:generate locally and confirm the diff comes back empty.

Verification

tsc --noEmit clean · 83 tests pass · yarn lint clean (one pre-existing TanStack warning) · yarn build succeeds.


Generated by Claude Code

Nothing has read or written `weekends.title` since labels became derived from
weekend_groups.number and weekends.type. Remove the column, along with the
`title` field on the Weekend domain type, the two queries still selecting it,
and the literals in the seed data.

The migration documents the two checks worth running against production first:
that no weekend's title was hand-edited to something the derived label won't
reproduce, and that every weekend is attached to a numbered group (a weekend
with no group number renders as "DTTD Mens", with no number to identify it).

database.types.ts was edited by hand to match — regenerate with `yarn db:generate`
against a reset local database to confirm.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCx4YdQiaFiE2Ss7TP9q3L
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dttd Ready Ready Preview Aug 12, 2026 1:02pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants