2026
Keys and Types the Database Can Actually Check
My status columns were text with a TypeScript union on top, and my ids came in three kinds. What Postgres enforces, what it only pretends to, and what I changed.
· 5 min · views
5 min viewsWhat Should Disappear When a User Is Deleted?
Every foreign key forces a decision about deletion. I went through MetaMove's tables one by one: cascade, restrict, or set null, and where none of them is the right answer.
· 6 min · views
6 min viewsOne Table Doing Two Jobs
member_assignments was my roster and my plan assignment at the same time. Two facts in one row gave the database two ways to be wrong, and a copy-pasted twin table made it worse.
· 6 min · views
6 min viewsMy Junction Table Had an Id and No Foreign Keys
Auditing one table in my fitness app taught me when a many-to-many table deserves its own id, why Drizzle relations are not constraints, and what rule the table actually needed.
· 7 min · views
7 min views