SQL

SQL Migration Tool

Database Automation

Documentation
perks

Why Plain SQL Matters

Most migration tools ask you to describe schema changes in a DSL, an ORM’s migration syntax, or some abstraction layer. SMT takes the opposite approach: your migrations are plain .sql files that you write, review, version, and execute yourself.

No surprises

You write exactly what gets executed; thus, no surprises from generated SQL.

Ready to implement

Your .sql files can be run directly in any database client, independently of the tool itself.

No Restrictions

There’s no lock-in to a specific language runtime, framework or ORM.

Take the control

Every migration lives in your version control system like any other source file.

Explore SQL Migration Tool
the process

Key Capabilities

From environment-specific configurations to explicit rollback scripts, SMT gives teams the tools to manage database changes consistently without hiding the underlying SQL.

As an open source data migration tool, it offers a transparent approach to schema management without forcing teams to adopt a new ORM or framework.

Contact Us
01

Multi-environment support

Manage dev, staging, and production from a single project configuration. Migrations are tracked per environment so you always know what’s been applied where.

02

Dynamic replacements

Use environment-specific placeholders to adapt the same SQL file to different database schemas, table prefixes, columns, or data values. Avoid maintaining separate migration files for every environment or tenant while keeping your SQL reusable and transparent.

03

Flexible credential management

Keep database credentials out of your source code. Load them from .env files or AWS Secrets Manager, or pass them at runtime through CLI arguments. Configure credentials for each environment to suit your security requirements and deployment setup.

04

Script support

Run ad hoc SQL scripts alongside versioned migrations. Handle data backfills, maintenance operations, one-off fixes, and other database tasks using the same dynamic replacement system.

05

Multi-project tracking

Track multiple migration projects against the same database using a unique identifier for each project.

06

Rollbacks via plain SQL

Define rollback operations using ordinary .sql files, just like your forward migrations. You decide exactly what happens when a change needs to be reversed.

technology

Who is this for?

Backend Developers & DBAs

For teams working with MySQL, PostgreSQL, or Microsoft SQL Server who need a reliable database migration tool to track schema changes, control deployments, and know exactly which migrations have been applied in each environment.

Microservices & Multi-Tenant Architectures

For teams managing multiple services or tenants that share a database server but need independent migration histories and control over their respective schemas.

Projects Inheriting Legacy Codebases

For teams that need a migration system without introducing a heavyweight ORM, changing their existing architecture, or abandoning the database tools and SQL workflows they already use.

Engineering Teams with CI/CD Pipelines

For teams that want to automate database migrations as part of their deployment process, applying changes reliably without interactive prompts or manual intervention.

Integrations

CI/CD Integration

Automate database migrations as part of the deployment workflow your team already uses.

SMT includes a CLI distributed through npm, making database automation easier by integrating migrations into Node.js-compatible CI/CD pipelines such as GitHub Actions, GitLab CI, and Jenkins.

1.
2am-smt init
2.
npm install -g @2amtech/sql-migration-tool
FAQs

You got questions?
We’ve got answers.

What are the benefits of using plain SQL for database migrations?

SQL Migration Tool uses plain .sql files for both migrations and rollbacks, so teams control exactly what executes. Files can run directly in database clients, remain in version control, and avoid ORM or framework lock-in. This approach supports transparent, portable database schema management across development, staging, and production environments today.

SMT supports MySQL, MariaDB, PostgreSQL, and Microsoft SQL Server. It provides multi-environment migration tracking, allowing teams to manage development, staging, and production from one project configuration. Each environment tracks its applied migrations separately, making schema changes easier to organize and monitor across different database environments securely and repeatably over time.

SMT supports dynamic replacements that inject environment-specific values into SQL files at execution time. Teams can target different schemas or table prefixes and insert environment-specific seed data without maintaining separate migration files. This keeps database changes consistent while accommodating differences between development, staging, production, and multi-tenant deployments consistently at runtime.

SMT supports both a desktop application and an npm-based CLI. The desktop app provides a visual interface for managing migration projects, reviewing history, and running scripts manually. The CLI is designed for automation, allowing migrations to run without interactive prompts or GUI dependencies in Node.js-compatible CI/CD pipelines reliably during deployments.

SMT supports flexible credential management without requiring database credentials in source code. Credentials can come from .env files or AWS Secrets Manager, or be supplied at runtime through CLI arguments. The tool also supports ad-hoc SQL scripts for data backfills, maintenance operations, and one-off fixes using dynamic replacements across environments.

More FAQs