fix(db): skip hyperdrive build migrations#868
Conversation
|
@onmax is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
|
@onmax you're a legend! 🙏 |
|
I've tried and it's still not running migrations during build full deployement worker logs if that helps |
|
@luminous8 I reproduced your report locally and it looks like it describes a second expectation rather than a regression in this PR. This PR fixes the original bug from #867: Hyperdrive-only PostgreSQL/MySQL configs should not fail With the current fix:
So if your expectation is "migrations should execute during Cloudflare build with only Hyperdrive", that is not what this PR implements. I opened #869 to track that follow-up separately. One thing I still want to confirm: did you test the PR package from the pkg.pr.new comment, or were your logs still from the published |
|
@onmax
The logs are from a test using from #868 (comment) PR package |
Closes #867
Summary
Cloudflare Hyperdrive bindings are only available at runtime, but NuxtHub still tried to run build-time migrations for Hyperdrive-only PostgreSQL/MySQL configs when
applyMigrationsDuringBuildwas enabled.This PR keeps the Hyperdrive runtime binding path unchanged and fixes one specific bug:
nuxt buildwhen no direct build-time connection URL is available.It does not make Hyperdrive-only configs run migrations during build. That follow-up is tracked in #869.
Behavior after this change
connection.hyperdriveIdis configured on Cloudflare and no direct build-time URL is available, NuxtHub preserves the Hyperdrive binding and skips build-time migrations.DATABASE_URL,POSTGRES_URL,POSTGRESQL_URL, orMYSQL_URL), build-time migrations still run.StackBlitz
CLI Reproduction
Verify fix
The
-fixfolder uses pnpm patch to apply the fix locally and verifies all of the following:.output/server/wrangler.json,connection.hyperdriveIdis available.