Prompt Buddy logoPrompt Buddy

drizzle · Drizzle ORM Docs

Drizzle ORM - Migrations

Explains how to manage database schema changes using Drizzle ORM through generating, applying, and managing migration files.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/drizzle-orm-migrations-workflow-guide.mdAn 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.textA 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.textAn 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.textA 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.textA 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.textA 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.textAn 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.textA 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.textAn 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.textA 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.textA 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.textA 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.textAn 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.textA 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.textA 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.textAn 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://orm.drizzle.team/docs/migrations