[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"pack-detail-db-schema-migration-fr":3,"seo:pack:db-schema-migration:fr":97},{"code":4,"message":5,"data":6},200,"操作成功",{"pack":7},{"slug":8,"icon":9,"tone":10,"status":11,"status_label":12,"title":13,"description":14,"items":15,"install_cmd":96},"db-schema-migration","🗄️","#7C2D12","new","Nouveau · cette semaine","Pack Conception de Schéma + Migrations de BD","Dix outils pour l'ingénieur qui possède la base : DrawDB pour visualiser, Atlas pour déclarer, quatre outils de migration (Liquibase, golang-migrate, dbmate, pgroll), Prisma + Drizzle pour l'ORM typé, Faker.js pour les seeds, plus une checklist expand-contract sans downtime.",[16,28,36,43,52,59,66,75,82,89],{"id":17,"uuid":18,"slug":19,"title":20,"description":21,"author_name":22,"view_count":23,"vote_count":24,"lang_type":25,"type":26,"type_label":27},2637,"c1320e30-47d6-11f1-9bc6-00163e2b0d79","drawdb-open-source-database-schema-diagram-editor-c1320e30","DrawDB — Open-Source Database Schema Diagram Editor","A free browser-based tool for designing, visualizing, and exporting database schemas with support for MySQL, PostgreSQL, SQLite, MariaDB, and SQL Server.","Script Depot",57,0,"en","skill","Skill",{"id":29,"uuid":30,"slug":31,"title":32,"description":33,"author_name":34,"view_count":35,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1702,"201b0f1d-3abe-11f1-9bc6-00163e2b0d79","atlas-declarative-database-schema-management-201b0f1d","Atlas — Declarative Database Schema Management","Atlas is a database schema management tool that uses a declarative approach to define and apply schema changes. It supports PostgreSQL, MySQL, SQLite, SQL Server, and ClickHouse with automatic migration planning and drift detection.","AI Open Source",106,{"id":37,"uuid":38,"slug":39,"title":40,"description":41,"author_name":22,"view_count":42,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1894,"1cbacb9a-3d5b-11f1-9bc6-00163e2b0d79","liquibase-database-schema-change-management-migration-1cbacb9a","Liquibase — Database Schema Change Management and Migration","An open-source database migration tool that tracks, versions, and deploys schema changes across relational databases using XML, YAML, JSON, or SQL changelogs.",111,{"id":44,"uuid":45,"slug":46,"title":47,"description":48,"author_name":34,"view_count":49,"vote_count":24,"lang_type":25,"type":50,"type_label":51},1696,"86a17dbc-3abd-11f1-9bc6-00163e2b0d79","golang-migrate-database-migrations-go-cli-86a17dbc","golang-migrate — Database Migrations for Go and CLI","golang-migrate provides a CLI and Go library for managing database schema migrations. It supports over 20 database drivers and reads migration files from local directories, cloud storage, or embedded Go sources.",62,"config","Config",{"id":53,"uuid":54,"slug":55,"title":56,"description":57,"author_name":22,"view_count":58,"vote_count":24,"lang_type":25,"type":26,"type_label":27},1703,"38618c4f-3abe-11f1-9bc6-00163e2b0d79","dbmate-lightweight-database-migration-tool-38618c4f","dbmate — Lightweight Database Migration Tool","dbmate is a simple, framework-agnostic database migration tool written in Go. It works with PostgreSQL, MySQL, SQLite, and ClickHouse using plain SQL migration files and a single binary with no dependencies.",110,{"id":60,"uuid":61,"slug":62,"title":63,"description":64,"author_name":34,"view_count":65,"vote_count":24,"lang_type":25,"type":26,"type_label":27},4100,"d4e550bd-51a7-11f1-9bc6-00163e2b0d79","pgroll-zero-downtime-postgresql-schema-migrations-d4e550bd","pgroll — Zero-Downtime PostgreSQL Schema Migrations","A Go-based migration tool for PostgreSQL that uses expand-and-contract patterns to apply schema changes without locking tables or breaking running applications.",34,{"id":67,"uuid":68,"slug":69,"title":70,"description":71,"author_name":72,"view_count":73,"vote_count":24,"lang_type":74,"type":26,"type_label":27},4264,"84ab1d5e-6fa5-42ed-bc57-443b0d997577","zero-downtime-db-migration-expand-contract-checklist-84ab1d5e","Zero-Downtime DB Migration — Expand Contract Checklist","Expand-contract database migration checklist for agents. Covers additive schema changes, batched backfills, rollback, and contract gates.","henuwangkai",51,"",{"id":76,"uuid":77,"slug":78,"title":79,"description":80,"author_name":22,"view_count":81,"vote_count":24,"lang_type":25,"type":26,"type_label":27},992,"2f0e03dd-3567-11f1-9bc6-00163e2b0d79","prisma-next-generation-orm-node-js-typescript-2f0e03dd","Prisma — Next-Generation ORM for Node.js & TypeScript","Prisma is a next-generation ORM for Node.js and TypeScript supporting PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB, and CockroachDB. Type-safe database access with auto-generated client and intuitive schema language.",216,{"id":83,"uuid":84,"slug":85,"title":86,"description":87,"author_name":22,"view_count":88,"vote_count":24,"lang_type":25,"type":26,"type_label":27},666,"0e904437-215d-4941-af94-eb0cf7424e0d","drizzle-orm-typescript-sql-feels-like-code-0e904437","Drizzle ORM — TypeScript SQL That Feels Like Code","Type-safe TypeScript ORM with SQL-like syntax. Zero overhead, serverless-ready, supports PostgreSQL, MySQL, SQLite. Schema as code with automatic migrations. 28,000+ GitHub stars.",158,{"id":90,"uuid":91,"slug":92,"title":93,"description":94,"author_name":34,"view_count":95,"vote_count":24,"lang_type":25,"type":26,"type_label":27},2137,"565112f4-40e4-11f1-9bc6-00163e2b0d79","faker-js-generate-realistic-fake-data-testing-565112f4","Faker.js — Generate Realistic Fake Data for Testing","Faker.js generates realistic fake data (names, addresses, emails, products, and more) for testing, seeding databases, and building prototypes in JavaScript and TypeScript.",114,"tokrepo install pack\u002Fdb-schema-migration",{"pageType":98,"pageKey":8,"locale":25,"title":99,"metaDescription":100,"h1":101,"tldr":102,"bodyMarkdown":103,"faq":104,"schema":120,"internalLinks":126,"citations":139,"wordCount":152,"generatedAt":153},"pack","Database Schema Design + Migration Pack — 10 Tools for the Engineer Who Owns the DB","DrawDB, Atlas, Liquibase, golang-migrate, dbmate, pgroll, expand-contract checklist, Prisma, Drizzle, Faker.js. Ten picks covering visualize, design, migrate, ORM, and seed — in deliberate install order with the tradeoffs spelled out.","Database Schema Design + Migration Pack — Ten Tools That Survive the 3 a.m. Schema Change","A working DB engineer's rig for designing schemas an agent can actually read, generating migrations that don't lock a 50M-row table, and seeding the result with data that resembles production. Visualize → declare → migrate → ORM → seed. Stack-agnostic: one pick per language family, one declarative layer that spans them all.","## What's in this pack\n\nAudience: you're the one who gets paged when a migration locks the `orders` table for nine minutes. You design schemas, write `ALTER TABLE` migrations, reverse-engineer a Postgres that someone else built in 2019, and generate ORM types so the backend stops drifting from the database. The thing your AI agent is still bad at is anything that touches **the real database** — a schema with 80 columns, an `events` table at 200M rows, a foreign key that nobody remembers adding.\n\nThis pack is ten tools that close that gap. The flow runs in a strict order: **visualize → design → migrate → ORM → seed → (production-safety checklist throughout).** Five buckets, each one unlocks the next.\n\n## Install in this order\n\n1. **DrawDB (id 2637)** — start here. Open-source, browser-based schema diagram editor. Paste a `CREATE TABLE` dump, get an ERD; draw an ERD, export DDL. Use it to **reverse-engineer an existing database** before you let an agent touch it. The agent works better with a diagram in context than with a 4000-line `schema.sql`.\n2. **Atlas (id 1702)** — the declarative layer. You write the target schema (HCL or SQL), Atlas computes the diff against the live DB and generates the migration. Supports PostgreSQL, MySQL, SQLite, SQL Server, ClickHouse. This is the most agent-friendly tool in the pack: agents are good at editing a declarative `schema.hcl`, bad at hand-writing imperative `ALTER` chains.\n3. **Liquibase (id 1894)** — the enterprise-grade migration layer. XML \u002F YAML \u002F JSON \u002F SQL changelogs, versioned, rollback-aware, JDBC-driver universe. Pick Liquibase if you ship Java, run cross-database, or your compliance team needs a `rollback` block on every change.\n4. **golang-migrate (id 1696)** — the Go-native migration CLI + library. 20+ database drivers, plain SQL up\u002Fdown files, no DSL to learn. Pair with any Go service; survives in CI as a single static binary.\n5. **dbmate (id 1703)** — the framework-agnostic alternative. Single Go binary, plain SQL, works with PostgreSQL, MySQL, SQLite, ClickHouse. Pick it over golang-migrate if you don't ship Go but still want a one-binary CLI with no Node\u002FPython\u002FRuby dependency.\n6. **pgroll (id 4100)** — Postgres-only, zero-downtime. Implements the expand-and-contract pattern automatically: dual-write the schema, backfill in batches, switch reads, drop the old column. Use this for the migration that scares you — the column rename on the 200M-row table.\n7. **Zero-Downtime DB Migration Checklist (id 4264)** — the methodology layer. A reusable agent checklist that walks any expand-contract migration: additive change, deploy app, backfill, dual-read window, deploy contract, drop old column. Keep this loaded so the agent doesn't shortcut to a destructive `ALTER`.\n8. **Prisma (id 992)** — the type-safe ORM for Node.js \u002F TypeScript. Schema-first: `schema.prisma` is the source of truth, `prisma migrate` generates SQL, `prisma generate` emits a fully typed client. Supports PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB, CockroachDB. The agent loves Prisma because errors surface at compile time, not 3 a.m.\n9. **Drizzle ORM (id 666)** — the lighter alternative. TypeScript-native, SQL-like syntax, zero runtime overhead, serverless-friendly. Pick Drizzle over Prisma when bundle size matters (edge, Workers, Lambda) or when you want to write SQL that still reads like SQL.\n10. **Faker.js (id 2137)** — the seed layer. Generate realistic names, addresses, emails, products in JS\u002FTS. Feed it into your ORM's seed script; now your dev DB has 10k rows that look real, which makes both your tests and your agent's example queries less of a fiction.\n\n## How they fit together\n\n```\n        ┌─────────────────┐\n        │  DrawDB (2637)  │  ← reverse-engineer existing DB,\n        └────────┬────────┘    or sketch new ERD\n                 │\n                 ▼\n        ┌─────────────────┐\n        │  Atlas (1702)   │  ← declarative target schema\n        └────────┬────────┘    diffs vs live DB → SQL\n                 │\n                 ▼\n┌────────────────┴───────────────────┐\n│  Migration runner (pick one stack) │\n│   Liquibase (1894) — Java \u002F XML    │\n│   golang-migrate (1696) — Go       │\n│   dbmate (1703) — single binary    │\n│   pgroll (4100) — zero-downtime PG │\n└────────────────┬───────────────────┘\n                 │\n   Expand-Contract Checklist (4264)\n   guards every destructive change\n                 │\n                 ▼\n        ┌─────────────────┐\n        │  ORM (Node\u002FTS)  │\n        │  Prisma (992)   │  ← schema-first, full client\n        │  Drizzle (666)  │  ← SQL-first, edge-ready\n        └────────┬────────┘\n                 │\n                 ▼\n        ┌─────────────────┐\n        │  Faker.js (2137)│  ← seed dev DB with realistic data\n        └─────────────────┘\n```\n\nThe loop that matters: **diagram the truth (DrawDB) → declare the target (Atlas) → migrate safely (Liquibase \u002F golang-migrate \u002F dbmate \u002F pgroll, gated by the expand-contract checklist) → expose typed access (Prisma or Drizzle) → seed with believable data (Faker.js).** Skip the declarative layer and your migrations are imperative spaghetti; skip the checklist and your agent will eventually drop a column in production.\n\n## Tradeoffs you'll hit\n\n- **Declarative (Atlas) vs imperative (golang-migrate \u002F dbmate)** — Atlas computes the diff for you, which is great for greenfield and small teams; imperative SQL files give you total control, which is what you want once your migration has business logic baked into the backfill. Most teams run both: Atlas for routine schema changes, hand-written SQL files for the gnarly ones.\n- **Liquibase vs golang-migrate \u002F dbmate** — Liquibase is XML-flavored, JDBC-flavored, and audit-friendly; the Go tools are plain SQL, single binary, CI-friendly. Pick Liquibase if compliance wants rollback metadata in version control; pick a Go tool if your team's instinct is \"just give me `.sql` files.\"\n- **pgroll vs writing expand-contract by hand** — pgroll automates the dual-write pattern for Postgres only. If you're on MySQL or cross-database, you'll write the dance yourself; checklist 4264 is the playbook. Don't try to retrofit pgroll on top of Liquibase — pick one or the other per migration.\n- **Prisma vs Drizzle** — Prisma owns the schema (`schema.prisma`); Drizzle expects you to own it (declared in TypeScript). Prisma is friendlier to AI agents because its DSL is small and consistent; Drizzle is friendlier to humans who already know SQL. Both ship migrations; both ship typed clients.\n- **Faker.js vs production snapshot** — fake data avoids the legal risk of copying production rows. A sanitized snapshot is more realistic but takes weeks to set up safely. Start with Faker; graduate to sanitized snapshots when you find a bug class that only repros at production cardinality.\n\n## Common pitfalls\n\n- **Letting the agent generate `DROP COLUMN` directly** — always route through the expand-contract checklist (4264). The agent will happily write a one-line migration that nukes a column still referenced by a deployed binary.\n- **Running pgroll and a generic migration tool on the same database** — they each write their own metadata tables and will fight. Pick one per database.\n- **Designing in DrawDB and forgetting to round-trip into Atlas** — the diagram is not the source of truth; the declarative schema file is. Export from DrawDB, paste into `schema.hcl`, then never edit the diagram again.\n- **Calling Faker once and committing the output** — Faker is non-deterministic by default. Seed it (`faker.seed(42)`) if you want reproducible test data, otherwise your CI will flake on row counts.\n- **Skipping the diagram step on an unfamiliar database** — agents misread a 4000-line `schema.sql`. They read a DrawDB ERD with 80% accuracy on first pass. Always reverse-engineer before refactoring.",[105,108,111,114,117],{"q":106,"a":107},"Why isn't a Postgres MCP server in this pack?","The MCP servers (PostgreSQL MCP, Postgres MCP Pro, DBHub, Supabase MCP) live in the sister pack 'Postgres for AI Agents' and in 'Backend Engineer's AI Toolkit' — both are linked below. This pack is the upstream piece: how the schema gets designed, migrated, and typed before any MCP server reads it. Install both packs together if you want the full data-layer rig.",{"q":109,"a":110},"Atlas or just Liquibase — pick one?","Different layers. Atlas is declarative (you write the target state, it computes the diff); Liquibase is imperative (you write the change, it tracks the history). Most mature teams run Atlas as the schema-as-code layer in version control, and Liquibase or golang-migrate as the executor that actually applies versioned changes in production. They compose. Picking only one is fine for a small team; pick Atlas if you mostly do additive schema work, Liquibase if you need rollback metadata for audit.",{"q":112,"a":113},"Why four migration runners — isn't that overkill?","It's one runner per stack reality: Liquibase for Java \u002F cross-DB \u002F enterprise, golang-migrate for Go shops, dbmate as the single-binary stack-agnostic option, pgroll specifically for zero-downtime Postgres. You install the one that fits your reality. The pack lists all four so the agent picks the right one for the project at hand instead of defaulting to whatever it saw most in training data.",{"q":115,"a":116},"Prisma vs Drizzle — which one should I pick today?","Prisma if you want a strict schema-first DSL the agent can edit safely and a generated client that catches misuse at compile time. Drizzle if you want SQL-first ergonomics, smaller bundle size for edge\u002Fserverless, and zero ORM runtime. Both ship migrations, both ship types. The honest split: Prisma for app teams that prize safety, Drizzle for infra teams that prize control.",{"q":118,"a":119},"Can I really seed production-like data with Faker?","For dev and CI, yes. For load testing or query-plan validation, you'll eventually want a sanitized production snapshot — Faker's distributions are uniform, real data has long tails. The compromise: seed dev with Faker (fast, no compliance burden), then maintain a separate sanitized-snapshot pipeline for the staging environment where you validate query plans before shipping.",{"@context":121,"@type":122,"name":123,"description":124,"numberOfItems":125,"inLanguage":25},"https:\u002F\u002Fschema.org","ItemList","Database Schema Design + Migration Pack","Ten tools curated for engineers who design database schemas, write migrations, reverse-engineer existing databases, and generate ORM types — covering visualize, declare, migrate, ORM, and seed in deliberate install order.",10,[127,131,135],{"url":128,"anchor":129,"reason":130},"\u002Fen\u002Ftopics\u002Fpostgres-for-agents","Postgres for AI Agents pack","Companion pack covering the MCP servers and runtime SQL surfaces that consume the schemas this pack designs",{"url":132,"anchor":133,"reason":134},"\u002Fen\u002Ftopics\u002Fbackend-engineer-ai-toolkit","Backend Engineer's AI Toolkit","Adjacent pack covering API contracts, scaffolding agents, and observability — the layers above the database",{"url":136,"anchor":137,"reason":138},"\u002Fen\u002Fai-tools-for\u002Fmcp","Browse all MCP servers","Once your schema is stable, hook it to an agent via a database MCP server from the catalog",[140,144,148],{"claim":141,"source_name":142,"source_url":143},"Atlas is a declarative schema management tool supporting PostgreSQL, MySQL, SQLite, SQL Server, and ClickHouse with automatic migration planning","Atlas official docs","https:\u002F\u002Fatlasgo.io\u002F",{"claim":145,"source_name":146,"source_url":147},"pgroll uses an expand-and-contract pattern to apply PostgreSQL schema changes without locking tables","pgroll GitHub","https:\u002F\u002Fgithub.com\u002Fxataio\u002Fpgroll",{"claim":149,"source_name":150,"source_url":151},"Prisma is a next-generation ORM for Node.js and TypeScript with schema-first migrations and a generated typed client","Prisma official docs","https:\u002F\u002Fwww.prisma.io\u002Fdocs",905,"2026-05-22T00:00:00Z"]