hey folks, what's the typical workflow for teams working with D1? I was able to get pages+d1 working

hey folks, what's the typical workflow for teams working with D1? I was able to get pages+d1 working great with preview environments etc, but a few things are falling short... every time I create a PR, I'm using wrangler pages deploy --branch $BITBUCKET_BRANCH to deploy a preview environment and wrangler d1 migrations apply --remote --env preview to apply the migrations to the preview db. that's awesome and pretty easy. however, all the preview envs share the same database, so how should I handle two PRs making db changes? or another very common use case: I start my PR with a single db change, but after PR reviews, I want to add/remove changes from the migration.
kinda the same issue as local development: if I checkout a branch to test it locally, then I can't really reset my local d1 instance to how it was before. I have to rm -rf ./.wrangler/state/v3/d1 and re-apply the migrations from main.
I'm just curious to understand how other teams with multiple people are working with D1 considering these factors. Thanks!
Was this page helpful?