Hi, I am new to the cloudflare d1. I am confused as to why the local data persist when deploying to

Hi,

I am new to the cloudflare d1. I am confused as to why the local data persist when deploying to production? I don't want the local data used for testing to be part of the production build. Only when deleting the local data inside the .wrangler/state/v3/d1/* files it displays the production data during deployment.

right now, I have 21 records in the d1 dashboard and locally I have 5 records. But on production the 5 records are displaying instead of the 21 records. Am I missing something? Or is this how the cloudflare build works?

I am using opennext to deploy next.js in cloudflare. these are the default script during the opennext cloudflare set up

"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"deploy": "cloudflare && wrangler deploy",
"preview": "cloudflare && wrangler dev",
"cf-typegen": "wrangler types --env-interface CloudflareEnv env.d.ts",
"build:worker": "cloudflare",
"dev:worker": "wrangler dev",
"preview:worker": "cloudflare && wrangler dev",
"deploy:worker": "npm run build:worker && wrangler deploy",
},

Appreciate any enlightenment. Also if this was previously asked and resolved, please kindly share the links to the post. Thank you!
Was this page helpful?