fix: initialize deployment databases and unblock guests - #54
Merged
Merged
Conversation
avatarneil
added this pull request to stack #53
September 14, 2026 00:17
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Serialize migrations on a direct Postgres connection and block deployment when migration setup or execution fails. Preview and local builds skip production migrations.
Remove the global Clerk loading gate that left public pages hanging when auth failed. Keep a stable guest key and preserve browser saves while identity resolves.
Run migrations for each Vercel preview as well as production. Reject mismatched runtime and migration database targets so schema changes cannot silently land on a different branch.
avatarneil
force-pushed
the
feat/production-migrations
branch
from
September 14, 2026 00:55
f6e36ca to
e606d03
Compare
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.
Public brackets now remain usable when Clerk fails or is slow to initialize. Removing the global auth-loading gate fixes the infinite “Loading bracket…” screen; a stable guest state key preserves typed input when guest auth finishes. Browser saves remain scoped by account. New Chromium and Firefox tests cover blocked Clerk scripts and delayed initialization.
Production and preview deployments now apply committed Drizzle migrations automatically before the Next.js build. Vercel's versioned build command runs the package build script, which invokes the deployment migration runner. Missing direct connection credentials or a failed migration stops the build.
A PostgreSQL session advisory lock serializes concurrent migration attempts on one direct connection. Drizzle's migration ledger makes retries idempotent; errors do not print connection details. Each preview migrates its own integration-provided database branch; local builds skip deployment migrations. The runtime and migration URLs must target the same database.
Set both
DATABASE_URL(pooled) andDATABASE_URL_UNPOOLED(direct) in Vercel Production using Neon'smainbranch. No manual deployment migration is needed. Configure both URLs for each preview through the Neon integration. Schema changes must remain compatible with the running app because migrations precede traffic switching; deployment rollback does not reverse schema changes.Validation: production build, lint (no new warnings), and all twelve migration/storage/unit tests passed against the isolated Neon development branch. CI also tests concurrent migration runners against a fresh Postgres service before running ownership and sharing tests. Production credentials and hosting settings remain user-managed.
Preview storage fix: confirmed the top preview was missing
account_bracketsand applied the schema to that isolated branch. All twelve migration/storage tests pass, including preview-mode migration and rejection of mismatched connection targets.