data
Technical notes on web development, DevOps, and AI integration.
4 articles
- 09:17backend
Moving a Category Between Modules Is a Two-Part Job
One UPDATE sounds finished. If the importer map keeps the old value, the next import quietly resurrects stale data.
TL;DR: Moving the souvenir category to tourism required more than a database update. The migration uses a guarded WHERE clause to stay idempotent and reversible, while the importer map was updated in the same commit to prevent the old value from resurrecting. Wrapping it in a transaction would not help since MySQL auto-commits DDL.
#mysql#database-migration#golang - 13:30frontend
The Three Metadata Layers Behind a Clean Next.js SEO Audit
Canonical, hreflang, metadataBase, and JSON-LD LocalBusiness: the three layers that made sixteen bilingual Next.js routes pass an SEO audit.
TL;DR: Sixteen bilingual Next.js routes passed a full SEO audit thanks to one metadata commit. Three layers did the work: a shared helper generating canonical and hreflang tags, metadataBase in the root layout, and JSON-LD marking up the business and website. Centralizing everything keeps URLs consistent, so new routes stay audit-proof instead of relying on Google to guess.
#nextjs#seo#i18n - 09:01devops
The Status Value That Shouldn't Exist Yet
A weeks-old file carried a status value the old reader never wrote. The vocabulary changed without a schema version bump. A lesson in data contracts.
TL;DR: A checker warning revealed a transcript file whose status value didn't exist in the old reader's vocabulary. The fix splits failures into unknown-status, where the reader lags, and legacy-enum-status, where a writer changed vocabulary without bumping the schema version. Lesson learned: treat enum changes as schema changes and bump versions in the same commit.
#python#schema#backward-compatibility - 12:23backend
My Derived Field Went Stale Three Days After I Backfilled It
A backfilled next_review went stale in three days. The fix: compute derived fields at read time and keep manual overrides.
TL;DR: A hand-run backfill for next_review went stale the moment one new file hit the index, exposing it as a derived field that shouldn't be stored. The real fix computes it at read time, only filling blanks so manual overrides survive. SQLite and PostgreSQL settled this long ago: derive on read, store only for overrides or heavy read performance.
#python#sqlite#postgresql