GitHubSupport MSR

MSR Core capabilities

Features for the Full Migration Lifecycle

Explore how MSR helps you discover, validate, run, and monitor migrations—and where adapters add database-specific behavior.

Create and run migrations

Organize database changes as versioned files and control exactly what runs.

TypeScript, JavaScript, and SQL

Keep code-based data changes and SQL scripts in a versioned workflow. Available file formats depend on the loaders supported by your adapter.

Migration discovery and ordering

Configure file patterns, recursive discovery, and version-based ordering to match your project structure.

Migration history and status

Track applied and pending migrations, execution timestamps, and checksums through the schema-version provider supplied by your adapter.

Batch execution and results

Run pending migrations in order and receive structured results, including execution status and timing.

Targeted and selective execution

Run migrations up to a chosen version or select files for a controlled run.

Forward and reverse migrations

Define `up()` and `down()` behavior, then set policies for migrations that do not have a reverse operation.

Validate and recover

Add checks before execution and choose how your application handles failures.

Pre-migration validation

Check migration structure, naming, and conventions before execution. Add custom rules or make warnings fail in strict mode.

Checksum and missing-file checks

Detect when an already-applied migration changes or disappears from the project, helping keep environments consistent.

Dry-run previews

See which migrations are planned without changing database data or creating backups.

Backups and rollback strategies

Configure backup behavior and choose between down migrations, backup restore, or a combination. The adapter provides database-specific backup operations.

Manage transactions and operations

Tune execution behavior to the guarantees and failure modes of your database.

Transaction boundaries

Choose transaction scope per migration, per batch, or none; configure timeouts and SQL isolation where the adapter supports them.

Retries for transient failures

Configure retry attempts and backoff for eligible transaction failures, such as deadlocks or serialization conflicts.

Optional migration locking

Coordinate concurrent migration runs across processes when the selected adapter provides a locking implementation.

Execution results and metrics

Return structured run summaries and collect execution timing and other metrics for operational visibility.

Configure and extend MSR

Use MSR from the command line or application code, and adapt it to your environment.

CLI and programmatic API

Run built-in migration commands or call the runner from a TypeScript or JavaScript application.

Environment and `.env` configuration

Load deployment-specific settings from environment variables, `.env` files, and supported JavaScript, JSON, YAML, TOML, or XML config files.

Database adapter APIs

Connect another database by implementing the handler and runner contracts used by MSR Core.

Hooks and custom tooling

Extend the workflow with lifecycle hooks, custom validators, loggers, output renderers, and migration loaders.

Feature support depends on the adapter

Core provides shared capabilities and contracts. Each adapter implements database-specific behavior to a different extent.

View the adapter support matrix