Week 056 — Phinx, Missing Columns, and a Production Route Bug
The production DB is out of sync. It was always going to happen eventually.
Week of December 15, 2025
Progress
Wednesday: warning cleanup across several files. A bug was found with reporting an item as found when it hadn't been reported lost first — the ItemService->reportLost() method had a parameter count change that wasn't accounted for in that code path.
Before fixing the parameter issue, a deeper problem surfaced: the cash-reward column didn't exist in the production database. It had been added manually to the dev DB and was never recorded anywhere that could be applied to other environments. This is the DB drift problem — the kind that gets worse the longer it's ignored.
The solution: Phinx, a PHP migration tool. Phinx lets you write incremental migration files that can be versioned with the code and applied to any database. Installing it required creating the migrations and seeds directories manually before the init command would run. There were also silent failures from a misconfigured bootstrap require and a constant definition error — fixed once identified.
Thursday: the subscription page route was failing in production but working in development. Root cause was logged-out state — the router was sending the request to 404 because the subscription route requires a logged-in user. Not obvious until stepping through the routing logic.
Decision Made
DB schema changes get a migration file from here on. The cash-reward column migration was the first one created, tested, and applied.
Next Week
Lost item map, map hardening, and the parameter fix for reporting a previously-unlost item as found.
