You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's easy to get a failure if the comment ends up at the bottom of the file.
Failure message is:
Error: D1_ERROR: SQL code did not contain a statement.
at D1DatabaseSessionAlwaysPrimary._sendOrThrow (cloudflare-internal:d1-api:129:19)
at D1DatabaseSessionAlwaysPrimary.batch (cloudflare-internal:d1-api:81:23)
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered:
bigmac44
changed the title
🐛 BUG: applyD1Migrations fails with output of readD1Migrations if last line of a migration is a comment
🐛 BUG: applyD1Migrations fails with output from readD1Migrations if last line of a migration is a comment
Jan 12, 2025
Which Cloudflare product(s) does this pertain to?
Workers Vitest Integration
What versions are you using?
3.101.0
What operating system and version are you using?
Mac Sequoia 15.2
Please provide a link to a minimal reproduction
No response
Describe the Bug
Following the example vitest configuration from:
https://github.com/cloudflare/workers-sdk/blob/d102b60238c1dddfdd829ffee62c451cb526717a/fixtures/vitest-pool-workers-examples/d1/vitest.config.ts
and
https://github.com/cloudflare/workers-sdk/blob/d102b60238c1dddfdd829ffee62c451cb526717a/fixtures/vitest-pool-workers-examples/d1/test/apply-migrations.ts
Will fail if one of the migrations contains a comment as its last line. Given that generating migrations with wrangler will insert a line like:
-- Migration number: 0001 2024-12-30T21:23:40.357Z
It's easy to get a failure if the comment ends up at the bottom of the file.
Failure message is:
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: