drizzle · Drizzle ORM Docs
Drizzle ORM - Migrations
Explains how to manage database schema changes using Drizzle ORM through generating, applying, and managing migration files.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Drizzle ORM - Migrations
Explains how to manage database schema changes using Drizzle ORM through generating, applying, and managing migration files.
When To Use
Use when you need to evolve a database schema, generate SQL migration files from TypeScript definitions, or apply schema changes to a live database using Drizzle Kit.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/drizzle-orm-migrations-workflow-guide.md | An overview of database schema migration concepts and management strategies within Drizzle ORM. | Questions about an overview of database schema migration concepts and management strategies within Drizzle ORM. |
examples/drizzle-orm-migrations-drizzle-kit-migration-commands-reference.text | A list of CLI commands for managing database migrations using drizzle-kit including generate, migrate, push, and pull. | Exact payloads, commands, or snippets shown in A list of CLI commands for managing database migrations using drizzle-kit including generate, migrate, push, and pull. |
examples/drizzle-orm-migrations-workflow-diagram.text | An ASCII art diagram illustrating the workflow between pulling a database schema and generating Drizzle schema files using drizzle-kit. | Exact payloads, commands, or snippets shown in An ASCII art diagram illustrating the workflow between pulling a database schema and generating Drizzle schema files... |
examples/drizzle-orm-migrations-pg-core.text | A TypeScript code example defining a PostgreSQL schema using drizzle-orm/pg-core for migration demonstrations. | Exact payloads, commands, or snippets shown in A TypeScript code example defining a PostgreSQL schema using drizzle-orm/pg-core for migration demonstrations. |
examples/drizzle-orm-migrations-pg-update.text | A TypeScript code snippet demonstrating how to add a new column to an existing PostgreSQL table schema within Drizzle ORM. | Exact payloads, commands, or snippets shown in A TypeScript code snippet demonstrating how to add a new column to an existing PostgreSQL table schema within Drizzle... |
examples/drizzle-orm-migrations-alteration-workflow.text | A text-based visualization of the workflow for adding a column to a database table using drizzle-kit push. | Exact payloads, commands, or snippets shown in A text-based visualization of the workflow for adding a column to a database table using drizzle-kit push. |
examples/drizzle-orm-migrations-drizzle-kit-generate-migration-workflow-ascii-dia.text | An ASCII diagram illustrating the step-by-step process of the drizzle-kit generate command for creating SQL migrations. | Exact payloads, commands, or snippets shown in An ASCII diagram illustrating the step-by-step process of the drizzle-kit generate command for creating SQL migrations. |
examples/drizzle-orm-migrations-sql.text | A sample SQL migration file demonstrating the structure of a generated Drizzle ORM migration script. | Exact payloads, commands, or snippets shown in A sample SQL migration file demonstrating the structure of a generated Drizzle ORM migration script. |
examples/drizzle-orm-migrations-workflow-diagram-2.text | An ASCII art diagram illustrating the step-by-step process of applying migrations using drizzle-kit. | Exact payloads, commands, or snippets shown in An ASCII art diagram illustrating the step-by-step process of applying migrations using drizzle-kit. |
examples/drizzle-orm-migrations-typescript-migrate-function-usage.text | A TypeScript code snippet demonstrating how to use the migrate function to run database migrations with a Drizzle ORM instance. | Exact payloads, commands, or snippets shown in A TypeScript code snippet demonstrating how to use the migrate function to run database migrations with a Drizzle ORM... |
examples/drizzle-orm-migrations-workflow-logic.text | A text-based representation of the step-by-step process for initializing database connections, reading SQL files, and applying unapplied migrations. | Exact payloads, commands, or snippets shown in A text-based representation of the step-by-step process for initializing database connections, reading SQL files, and... |
examples/drizzle-orm-migrations-workflow-cli.text | A text representation of the drizzle-kit generate command execution flow and the resulting migration file structure. | Exact payloads, commands, or snippets shown in A text representation of the drizzle-kit generate command execution flow and the resulting migration file structure. |
examples/drizzle-orm-migrations-workflow-diagram-3.text | An ASCII art diagram illustrating the migration workflow from generating migration files to applying them to a database. | Exact payloads, commands, or snippets shown in An ASCII art diagram illustrating the migration workflow from generating migration files to applying them to a database. |
examples/drizzle-orm-migrations-drizzle-kit-export-command-usage.text | A text representation of the drizzle-kit export command output and its workflow steps. | Exact payloads, commands, or snippets shown in A text representation of the drizzle-kit export command output and its workflow steps. |
examples/drizzle-orm-migrations-sql-create-table.text | A SQL snippet demonstrating the structure of a table definition within a Drizzle ORM migration file. | Exact payloads, commands, or snippets shown in A SQL snippet demonstrating the structure of a table definition within a Drizzle ORM migration file. |
examples/drizzle-orm-migrations-atlas-workflow-diagram.text | An ASCII art diagram illustrating the migration workflow using Atlas to apply changes to a database. | Exact payloads, commands, or snippets shown in An ASCII art diagram illustrating the migration workflow using Atlas to apply changes to a database. |
What This Skill Covers
- SQL databases require you to specify a strict schema of entities you’re going to store upfront and if (when) you need to change the shape of those entities -...
- Main sections:
How can Drizzle help?.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://orm.drizzle.team/docs/migrations