Migrator - Database migration manager
Minimal dependency, command-line interface application for centralized database migration management, currently supporting PostgreSQL and SQLite.
tools and technologies
- TypeScript
- Nodejs
- SQLite
- Jest
- GitHub Actions
According to the OWASP Top 10:2025, suppy chain attacks were the third most critical security risk in the year 2025. They also have the potential to climb up on the ladder, in light of recent successful attacks on Axios, Nextjs, Tanstack, other packages in the NPM registry and Laravel just to name a few.
For this reason, i challenged myself not only to dive deeper into working with the CLI to create a user friently interface, but to omit using any dependency that is not a database driver.
OWASP Top10:2025features
- Create 'projects', which consist of a database connection string and the location of migration files
- Run 'up' or 'down' migrations
- Migration state metadata are persisted in the database the program operates on
- Watch event logs of past migrations
technicalities
The project source consist of a few clearly separated files and directories to support reusability and to make it easier to add functionality, change implementation or refactor down the line. This includes the router which powers navigation throughout the application.
The migration runner executes SQL using transactions, so if an error occurs, it won't mess up the database. Besides this, each migrations result is logged in a SQLite database, so there is a clear footprint of what and when happened.
Modern terminal UI elements, like spinner, select menu, user input and colors implemented with ANSI escape codes.