DeesseJS
  • Enterprise
  • Pricing
DeesseJS logoDeesseJS

Software engineering as a commodity: agents that code, workflows that scale, infrastructure that works. Built with the DeesseJS ecosystem.

Ecosystem

  • Errors
  • DRPC
  • Collections
  • FP

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base

Use cases

  • SaaS apps
  • AI products
  • Landing pages
  • API backends
  • Internal tools

Company

  • About
  • Manifesto
  • Principles
  • Vision
  • Enterprise
  • Delivery
  • Help

Legal & Trust

  • Privacy
  • Terms
  • Cookies
  • DPA
  • Security

Community

  • Open Source Program
  • Github
  • LinkedIn
  • X

Explore

  • Customers
  • Templates
  • Ecosystem
  • Stack
© 2026 DeesseJS. All rights reserved.
  1. Knowledge Base
  2. Databases
  3. Manage Postgres migrations
postgresdrizzlemigrations

Manage Postgres migrations

Drizzle migrations in CI, rollback, zero-downtime schema changes.

Drizzle generates SQL migrations from the schema diff. The pipeline runs them in CI before the deploy hits, and a separate rollback migration is generated when a schema change is destructive.

1. Author the schema

Edit the relevant file in packages/database/src/schema/<table>.ts. Drizzle's schema helper enforces the column types.

2. Generate the migration

pnpm db:generate

The generated SQL lands in packages/database/migrations/<timestamp>_<name>.sql.

3. Apply

pnpm db:migrate

In production, the CI step runs this before the Vercel build. A failing migration aborts the deploy.

4. Rollback

For destructive changes, write the rollback SQL in the same migration file under -- rollback:. The CI tooling detects this comment and ships the rollback alongside.

What's next

  • Use the Next.js RAG template — the documents table lives under migrations.
  • Production readiness checklist — verify migration runbook before the first prod promotion.

Similar guides

  • 2026-09-09

    Run background jobs

    Queue and worker patterns for async work outside your request path.
    background-jobsasync
    David PereiraChief Executive Officer
    1 min read
  • 2026-08-12

    Deploy to Vercel

    Connect your repo, configure environments, and run your first production build.
    vercelproductionci-cd
    David PereiraChief Executive Officer
    2 min read

Ready to ship?

Read more, or ship with us.

Subscribe to the blog and changelog feeds, install the CLI to scaffold a project in under five minutes, or talk to our delivery team if you need a hand. Same templates, same contracts, same guarantees.

Install the CLIBrowse the registry