npx wrangler d1 migrations create my-db add-users-table

Category: Cloudflare

npx wrangler d1 migrations create my-db add-users-table

Create a new D1 migration file

Generates a timestamped SQL file in the migrations folder named for your change, e.g. 0001_add-users-table.sql, ready for you to edit. Migrations are versioned schema changes that D1 tracks as applied. Name them as a description of the change; the description is what makes history readable.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.