Skip to content

Instantly share code, notes, and snippets.

@abuiles
Created February 15, 2025 00:49
Show Gist options
  • Save abuiles/4bcd6f7992c8952e82f4373621a6c717 to your computer and use it in GitHub Desktop.
Save abuiles/4bcd6f7992c8952e82f4373621a6c717 to your computer and use it in GitHub Desktop.
Create new migrations with this command:
npx wrangler d1 migrations create <DATABASE_NAME> <MIGRATION_NAME>
After creating a new migrations with the previous command - don't change the first line which starts like:
-- Migration number: 00XX 2024-12-31T16:56:07.004Z
The previous line is autogenerated.
List migrations with this command
npx wrangler d1 migrations list <DATABASE_NAME> [OPTIONS]
Apply migrations with
npx wrangler d1 migrations apply <DATABASE_NAME> [OPTIONS]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment