Skip to content

Sync: dev to main - #622

Merged
aamoghS merged 4 commits into
mainfrom
dev
Nov 15, 2026
Merged

aamoghS merged 4 commits into
mainfrom
dev

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Automated PR tracking changes from dev into main.


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 every timestamp column across Drizzle schemas (auth, hackathons, judging, members, events, payments, etc.), so stored instants are not tied to the session TimeZone.

Application SQL is aligned with that shape: verification token inserts/comparisons in auth now cast to timestamptz instead of timestamp, and bulk hackathon check-in uses plain now() for checked_in_at (dropping the previous now() 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.mts now 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.

aamoghS and others added 4 commits November 14, 2026 18:47
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.
@github-actions

Copy link
Copy Markdown
Contributor Author

@greptileai

@aamoghS aamoghS closed this Nov 15, 2026
@aamoghS aamoghS reopened this Nov 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

Copy link
Copy Markdown
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

@github-actions

Copy link
Copy Markdown
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

@aamoghS
aamoghS merged commit e25ddb4 into main Nov 15, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant