Skip to content

fix: add withTimezone to all wxyc_schema timestamp columns#196

Merged
jakebromberg merged 2 commits intomainfrom
fix/39-timestamp-timezone
Mar 10, 2026
Merged

fix: add withTimezone to all wxyc_schema timestamp columns#196
jakebromberg merged 2 commits intomainfrom
fix/39-timestamp-timezone

Conversation

@jakebromberg
Copy link
Member

@jakebromberg jakebromberg commented Feb 21, 2026

Summary

  • All 14 timestamp() columns in wxyc_schema tables were missing { withTimezone: true }, making them ambiguous during DST transitions. Auth tables (public schema) already used withTimezone. This aligns the two.
  • Adds a unit test (tests/unit/database/schema.timestamps.test.ts) that reads the schema source and asserts every timestamp() call includes withTimezone: true, preventing future regressions.
  • No migration generated — that will be a separate step.

Affected tables

shift_covers, artists, library, flowsheet, genres, reviews, shows, specialty_shows, album_metadata, artist_metadata

Test plan

  • Unit test fails before fix (14 columns detected)
  • Unit test passes after fix
  • Verify existing integration tests still pass in CI
  • Generate and review migration separately before deploying

Closes #39

Made with Cursor

Note: This fix is consolidated in #199 (coordinated schema migration batch). Consider closing in favor of #199.

Copy link
Collaborator

@AyBruno AyBruno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good for safety I suppose, but any inserts/updates we perform on timestamp fields already default to UTC and shouldn't technically require this.

Jake Bromberg and others added 2 commits March 9, 2026 20:57
Timestamps without timezone are ambiguous during DST transitions.
Auth tables already used withTimezone; now wxyc_schema tables match.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jakebromberg jakebromberg force-pushed the fix/39-timestamp-timezone branch from f715f08 to b8f1336 Compare March 10, 2026 03:57
@jakebromberg jakebromberg merged commit fbeba5e into main Mar 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants