Is possible to run migrations in Pages build command?
I'm not sure what is the right flow to run D1 migrations... If I understand it correctly so far, you have to:
Push migrations with a command:
and then push the changed app code (wich rely on new DB schema) to git.
Shouldn't be a migration run right after the deployment in the "build command" like:
Is this possible?
I tried the comamnd and got the error:
After creating CLOUDFLARE_API_TOKEN env var I get this error:
Push migrations with a command:
npx wrangler d1 migrations apply db-name as a wrangler command from the local env to make changes in the prod. DBand then push the changed app code (wich rely on new DB schema) to git.
Shouldn't be a migration run right after the deployment in the "build command" like:
npm run build && npx wrangler d1 migrations apply db-nameIs this possible?
I tried the comamnd and got the error:
After creating CLOUDFLARE_API_TOKEN env var I get this error:
