fix(db): use gen_random_uuid for PostgreSQL compatibility #2133
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.
Follow-up to #2131 that resolves migration failures for users without the
pg_uuidv7extension.Database
Switches from
uuid_generate_v7()togen_random_uuid()for universal PostgreSQL support. The pg_uuidv7 extension isn't always available (especially in local dev or hosted environments outside Neon / Cloud SQL).For projects that need time-ordered UUIDs (better index locality), the README documents alternatives:
Also adds
casing: "snake_case"to Drizzle config to ensure camelCase TypeScript fields map correctly to snake_case database columns.OAuth Login Flow
Simplifies the post-OAuth redirect handling:
returnUrl,redirect, loading spinners, and manualuseEffectpollingreturnToparam validated via Zod schema,router.invalidate()handles session refreshMigration
For existing deployments using
uuid_generate_v7():bun --filter @repo/db generateto create a fresh migration reflecting the new defaultsNew installations will use
gen_random_uuid()automatically.Ref #2108 #2114