ChatGPT Sites + D1 + Drizzle migrations: how does Sites know which migration to apply? #42848
Replies: 1 comment
|
The key distinction seems to be between standard Cloudflare D1 migrations and whatever migration orchestration ChatGPT Sites adds on top. For normal D1/Workers deployments, Cloudflare's migration system keeps applied-migration state in a So if Sites is using the standard D1 migration mechanism underneath, 0000 would normally be recorded there and a later deployment containing 0000 + 0001 would apply only 0001. However, I don't see public Sites documentation that establishes that Given that you've already seen conflicting guidance, I'd avoid adding a second app-managed migration system until the Sites-specific behavior is confirmed. Otherwise you could end up with two independent migration owners. The most useful thing to confirm from the Sites implementation/docs would be:
Until those are documented, I'd treat the Sites-specific migration lifecycle as an implementation detail rather than assuming standard Wrangler behavior. |
Uh oh!
There was an error while loading. Please reload this page.
I’m using ChatGPT Sites with a Sites-managed Cloudflare D1 binding called DB, and the project uses Drizzle-generated SQL migrations.
The deployment package currently contains:
Production already reflects the schema from 0000, but I cannot find any visible migration ledger such as a d1_migrations table, and Sites does not expose the underlying production D1 database name/UUID.
The next migration (0001) is additive and adds three columns to an existing newsletter_signups table.
What is confusing me is that I’ve seen two different directions:
Those two models seem incompatible unless Sites has its own hidden migration-tracking mechanism.
Has anyone here actually deployed a Sites project with a second D1 migration?
I’m specifically trying to understand:
I’ve paused the production release because I don’t want both the platform and the app trying to own the same schema change.
Any first-hand experience with Sites + D1 + Drizzle migrations would be very helpful.
All reactions