1. MooseStack
  2. Migrate
  3. Migration Modes

On this page

OverviewAutomatic MigrationsPlanned MigrationsUse CasesSee Also

Migration Modes

Moose Migrate offers two complementary modes for generating and applying migrations. Each is designed for use in different stages of the application lifecycle, and it's best practice to use both in your workflow:

  • Automatic Migrations - Changes are instantly applied to your database without any manual review. Designed for local development and rapid iteration.
  • Planned Migrations - Changes are staged in a reviewable and editable plan file. Designed for production deployments and CI/CD pipelines.

Overview

Automatic MigrationsPlanned Migrations
Primary Use CaseLocal DevelopmentProduction Deployment
TriggerFile Save / Watchermoose generate migration
ArtifactNone (Immediate SQL Execution)Migration Plan (plan.yaml)
SafetyLow (Optimized for speed)High (Optimized for safety)
ReviewableNoYes
Drift DetectionNoYes

Automatic Migrations

Designed for the "inner loop" of development, Automatic Migrations prioritize velocity. As you iterate on your data models in code, Moose automatically applies the necessary changes to your local database in real-time.

  • Optimized for: Prototyping, local development, rapid iteration.
  • Key Characteristic: Invisible, instant schema updates.
  • Risk: Can be destructive (e.g., renaming a field drops the column).

Read the Automatic Migrations Reference →

Planned Migrations

Designed for the "outer loop" of deployment, prioritize safety. This mode separates the of changes from their , creating a static artifact that can be reviewed, tested, and versioned.

Planned Migrations
generation
execution
  • Optimized for: Production deployments, team collaboration, CI/CD.
  • Key Characteristic: Reviewable, editable migration plans.
  • Risk: Minimal (requires explicit approval and handles drift detection).

Read the Planned Migrations Reference →

Use Cases

ScenarioRecommended ModeRationale
Local PrototypingAutomaticYou want to iterate quickly on your schema without running commands for every change.
Production DeploymentPlannedYou need to ensure that schema changes are safe and do not accidentally delete user data.
CI/CD PipelinePlannedYou need to apply migrations in a deterministic way as part of your deployment process.
Renaming ColumnsPlannedYou need to explicitly tell the database to rename a column instead of dropping and re-adding it.
Team ReviewPlannedYou want to review schema changes in a Pull Request before they are applied.

See Also

  • Automatic Migrations
  • Planned Migrations
  • Lifecycle Management
  • Overview
  • Quick Start
  • Templates / Examples
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
MooseStack in your App
  • App / API frameworks
Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Changelog
Contribution
  • Documentation
  • Framework
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506