Skip to content

fix(auth): support datetime for MySQL auth dates - #968

Merged
cpojer merged 2 commits into
mainfrom
fix/mysql-auth-datetime
Nov 29, 2026
Merged

cpojer merged 2 commits into
mainfrom
fix/mysql-auth-datetime

Conversation

@hyfdev

@hyfdev hyfdev commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

On MySQL, signing up with a 1960 date in a custom birthday field fails with 422 FAILED_TO_CREATE_USER when the auth tables come from void db generate and void db migrate, because TIMESTAMP can't hold dates before 1970.

With authDateType set to 'datetime' in void.config.ts, it returns 200, and the same date reads back:

database: { dialect: 'mysql', authDateType: 'datetime' },

In the generated migration:

- `birthday` timestamp(3),
+ `birthday` datetime(3),

New MySQL starters set this option. Projects without it keep TIMESTAMP(3), so this signup still fails there.

An existing project can switch by setting the option, then running void db generate and void db migrate. That migration keeps existing dates when it runs in the session time zone the app wrote them with. The MySQL guide says to test it on a copy first.

Fixes #967.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-mysql-auth-datetime-void-cloud.voidzero-docs.workers.dev (commit b6af283)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://98a07e22-void-cloud.voidzero-docs.workers.dev b6af283 2026-11-29T09:10:16.277Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://1a8d9e7a-void-cloud.voidzero-docs.workers.dev d1f6a04 2026-11-29T01:06:14.128Z Visit the dashboard ↗

@hyfdev
hyfdev marked this pull request as ready for review November 29, 2026 01:41
Copilot AI balanced review requested due to automatic review settings November 29, 2026 01:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@cpojer
cpojer force-pushed the fix/mysql-auth-datetime branch from d1f6a04 to b6af283 Compare November 29, 2026 09:09

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@cpojer
cpojer merged commit bff6076 into main Nov 29, 2026
26 of 28 checks passed
@cpojer
cpojer deleted the fix/mysql-auth-datetime branch November 29, 2026 09:16
@hyfdev hyfdev changed the title fix(auth): generate MySQL dates as datetime fix(auth): support datetime for MySQL auth dates Nov 29, 2026
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.

Generated MySQL auth schema uses TIMESTAMP(3), so a 1960 birthday fails signup

3 participants