Database migrations have a reputation for going wrong at the worst possible moment. Omitted rollback scripts, schema changes applied to production but not staging, credentials hardcoded in a config file that someone committed by accident… These are the kind of incidents that haunt database administrators and backend engineers, and they are far more common than most teams would like to admit.
The SQL Migration Tool (SMT) is a free desktop app and an open-source CLI utility that empowers backend developers and engineering teams with consistency, traceability, and control over database schema management.
Plain SQL By Design
Most migration tools require developers to describe schema changes through a framework-specific syntax or an ORM layer. SMT takes the opposite approach. Migrations are standard .sql files. What gets executed is exactly what was written. The files can be run directly in any database client, independently of the tool, and they live in version control alongside the rest of the codebase.
Scripts are supported which are also SQL files with dynamic replacements which can be run to perform common database maintenance tasks.
SQL files do not have any special annotations so they can still be used in existing Database Administrator's tool of choice.
What It Does
SMT supports MySQL/MariaDB, PostgreSQL, and Microsoft SQL Server. Teams can manage multiple environments from a single project configuration, with each environment tracking its own database changes, so rollouts can be granular. Rollback scripts are plain SQL files as well, with nothing inferred and nothing hidden.
No need for hardcoded credentials. SMT can read credentials from different sources for each environment to connect to the database. For teams working in AWS environments, SMT integrates with AWS Secrets Manager out of the box. Local development setups can use .env files instead. For local or sandbox testing where security is not needed, directly entered credentials can still be provided.
Environment specific database differences like different table prefixes, columns and schemas are not a problem. With Dynamic Replacement support, rather than maintaining separate SQL files for each environment, teams can define environment specific search and replace placeholders so that different environments run a SQL targeting the proper tables at runtime. This means the same migration file can target a different schema name in a test environment versus production one, use different table prefixes per tenant in a multi-tenant setup, or insert different seed data depending on where it is being deployed. One file, cleanly adapted to wherever it runs.
Friendly for both Database Administrators and DevOps
SMT is available both as a desktop application and a CLI package. Both are released under the MIT license and are free for personal and commercial use.
Desktop application allows Database Administrators to add and manage the migrations across many projects with a simple and intuitive user interface. Available for all major operating systems: macOS, Windows, and Linux. Migrations can also be run directly from the GUI app.
For DevOps CI/CD workflows, the CLI can be used to automatically apply these migrations during a deployment. It installs via npm in a single command and can run with zero user interaction needed. It integrates nicely with any environment which can run Node, Bun or Deno runtime.
The SQL Migration Tool is available now. Full documentation is available via 2am.tech.
Accelerate Your Career with 2am.tech
Join our team and collaborate with top tech professionals on cutting-edge projects, shaping the future of software development with your creativity and expertise.
Open Positions