Repository navigation
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.
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.
Feature: refactor/db-timestamptz to dev
Contributor
Author
Contributor
Author
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
Author
|
Visit the preview URL for this PR (updated for commit e1d778f): https://hacklyticss2026--pr-622-inakbm14.web.app (expires Sun, 22 Nov 2026 00:04:58 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 5d238be33273095766c18a8339b7b0c47de8a950 |
Contributor
Author
|
Visit the preview URL for this PR (updated for commit e1d778f): https://hacklytics2027--pr-622-2d766iik.web.app (expires Sun, 22 Nov 2026 00:05:07 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c48ba34db61581e25fe2978355160b5eefe0e83f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated PR tracking changes from
devintomain.Note
High Risk
Wide-reaching schema type changes plus auth expiry handling and check-in timestamps; a partial migration would leave code and DB semantics misaligned until push completes.
Overview
This PR standardizes Postgres timestamps by declaring
withTimezone: true(timestamptz) on essentially everytimestampcolumn across Drizzle schemas (auth, hackathons, judging, members, events, payments, etc.), so stored instants are not tied to the sessionTimeZone.Application SQL is aligned with that shape: verification token inserts/comparisons in auth now cast to
timestamptzinstead oftimestamp, and bulk hackathon check-in uses plainnow()forchecked_in_at(dropping the previousnow() at time zone 'utc'workaround). Check-in points logic only updates comments around using one app clock for rule checks vs rows written.Operational guardrail:
check-drift.mtsnow compares live column types to the schema and fails if a timestamp column’s time-zone storage doesn’t match what Drizzle declares—catching pushes where column ALTERs didn’t apply.Deploying this requires the corresponding
migrate:push(or equivalent) so production column types actually change; until then, drift check should fail loudly.Reviewed by Cursor Bugbot for commit e1d778f. Bugbot is set up for automated code reviews on this repo. Configure here.