Skip to content

fix: force database binding in manifest when migrations exist - #66

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/migration-binding-consistency
Apr 2, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/migration-binding-consistency

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Apr 2, 2026 •

Copy link
Copy Markdown
Member

When a user removed D1 usage from source code but left migration files
in db/migrations/, deploys failed with "migration failed: no D1 binding
found". The migration collection and binding inference systems were
independent with no cross-check, producing a manifest with migrations
but no database binding.

Add hasMigrations to the binding condition in both packageBuild and
packageFrameworkBuild so migrations on disk always imply a database
binding in the manifest.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com


Note

Medium Risk
Changes affect deploy-time provisioning and the generated deploy manifest for database projects, which can impact runtime bindings and migration execution behavior. Test updates reduce CI flakiness but alter how integration coverage is exercised (preview vs dev).

Overview
Fixes deploy/package inconsistencies where db/migrations could be uploaded/run without a corresponding DB binding in the manifest.

Packaging now treats presence of migrations as implying a database: packageBuild/packageFrameworkBuild add d1 (SQLite) or hyperdrive (Postgres) bindings whenever migrations are included, and deploy preflight Hyperdrive provisioning is expanded to also trigger when migrations exist (even if binding inference says no DB). Adds a comprehensive unit test suite around migration↔binding consistency, and stabilizes the kitchen-sink integration test by switching from vite dev to a build + vite preview flow and explicitly applying local migrations before browser assertions; waitForServer can now fail fast if the spawned server exits.

Written by Cursor Bugbot for commit 4533692. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Brooooooklyn
Brooooooklyn force-pushed the fix/migration-binding-consistency branch 2 times, most recently from 0e073a3 to cff2533 Compare April 2, 2026 08:01

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cff2533ed5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/cli/package.ts
@Brooooooklyn
Brooooooklyn force-pushed the fix/migration-binding-consistency branch from cff2533 to 6397c3c Compare April 2, 2026 08:16

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6397c3cb55

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/plugin-routing.ts Outdated
Comment thread packages/void/src/plugin-routing.ts Outdated
@Brooooooklyn
Brooooooklyn force-pushed the fix/migration-binding-consistency branch from 6397c3c to a317ee3 Compare April 2, 2026 08:36

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a317ee3abe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/test/integration/kitchen-sink.test.ts
@Brooooooklyn
Brooooooklyn force-pushed the fix/migration-binding-consistency branch from a317ee3 to aa36642 Compare April 2, 2026 08:49

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa366428fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/cli/deploy.ts
When a user removed D1 usage from source code but left migration files
in db/migrations/, deploys failed with "migration failed: no D1 binding
found". The migration collection and binding inference systems were
independent with no cross-check, producing a manifest with migrations
but no database binding.

Add hasMigrations to the binding condition in both packageBuild and
packageFrameworkBuild so migrations on disk always imply a database
binding in the manifest.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Brooooooklyn
Brooooooklyn force-pushed the fix/migration-binding-consistency branch from aa36642 to 4533692 Compare April 2, 2026 09:28
@Brooooooklyn
Brooooooklyn merged commit f964d3d into main Apr 2, 2026
8 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/migration-binding-consistency branch April 2, 2026 09:50
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.

1 participant