Skip to content
tutorial-migration

Migration Tutorial

Migration Tutorial

This tutorial covers PlanSchemaChanges, SQLPreview, ValidateSchemas, and AutoMigrate.

When to Use

  • You need DDL visibility before applying schema changes.
  • You want CI checks for schema compatibility.

Complete Example

Pitfalls

  • Over-relying on AutoMigrate for destructive/unsafe changes.
  • Skipping SQL preview in release pipeline.

Verify

go test ./dbx/... -run Migrate