Repository navigation
Feature: refactor/db-timestamptz to dev - #621
Conversation
All 156 timestamp columns were timestamp without time zone. They held UTC wall time only because production sessions run in GMT and drizzle writes toISOString(); a session in another zone, or raw SQL comparing them with now(), would read them hours off. Declare them withTimezone, as status_sample already was. push converts each with SET DATA TYPE, which casts through the session zone (GMT in production), so every stored instant is kept. The one raw write that worked around the old type (now() at time zone 'utc' in admin/status.ts) is now plain now(). Rehearsed on a PGX copy: 156 conversions, no prompt, sampled instants unchanged, full suite passes.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Visit the preview URL for this PR (updated for commit 66cd0c5): https://hacklyticss2026--pr-621-z59orv6a.web.app (expires Sun, 22 Nov 2026 00:00:10 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 5d238be33273095766c18a8339b7b0c47de8a950 |
|
Visit the preview URL for this PR (updated for commit 66cd0c5): https://hacklytics2027--pr-621-u1di3r1u.web.app (expires Sun, 22 Nov 2026 00:00:11 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c48ba34db61581e25fe2978355160b5eefe0e83f |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 66ca30c. Configure here.
The verification-token SQL cast its ISO instants with ::timestamp, which drops the Z and lets the session TimeZone reinterpret the wall time once verificationToken.expires stores a zone. In a non-UTC session that shifts code expiry and the once-a-minute send gate by hours. ::timestamptz keeps the instant.
db:check only confirmed that declared columns exist, so a push that skipped a type change (timestamp to timestamptz) left the old type and still passed, and the build shipped code expecting the new one. It now compares every timestamp column's time zone with the declaration and fails the build on a mismatch, which keeps the running revision in place.

Automated PR tracking changes from
refactor/db-timestamptzintodev.Note
High Risk
Wide schema type change plus auth token expiry handling; requires a successful migrate push and affects time-sensitive check-in and verification flows.
Overview
Moves the database layer to timezone-aware timestamps (
timestamptz) so appDatevalues, SQLnow(), and stored instants stay aligned regardless of the Postgres session time zone.Every Drizzle
timestampcolumn acrosspackages/db/src/schemasnow declares{ withTimezone: true }. Auth raw SQL casts verification-tokenexpiresas::timestamptz, and hackathon bulk check-in stops usingnow() at time zone 'utc'in favor of plainnow()/ updated comments inpoints.tsfor the same reason.check-drift.mtsnow fails if live columns are stilltimestamp without time zonewhen the schema expectswith time zone, catching pushes that did not actually alter column types.Reviewed by Cursor Bugbot for commit 66cd0c5. Bugbot is set up for automated code reviews on this repo. Configure here.