How do you execute D1 migration with Worker Build?
Is it possible to perform migration to d1 by CI/CD with workers build? Currently, I have set up a deploy command that executes bunx wrangler d1 execute migration apply and bunx wrangler deploy in sequence. How do you guys do it?
1 Reply
@PatrickJ
Yes. I am also able to perform migration by running the following shell.
My deploy command in Cloudflara Workers Build menu is below.
chmod +x ./misc/scripts/deploy.sh && ./misc/scripts/deploy.sh "staging" "my-d1-database-name"
I'm separating workers by env (staging, production, etc..).
so arguments in ./misc/scripts/deploy.sh is ok for fixed value.