migrateDB
SHIPPEDA TypeScript migration CLI and library with dependency-ordered execution, published to npm.
Personal project · Nov–Dec 2025
THE PROBLEM
Migrations often depend on each other, and file-name order doesn't express that.
HOW IT WORKS
- Migrations declare dependencies with a comment annotation. A depth-first topological sort orders them and detects cycles and missing dependencies.
- A single-row lock table prevents concurrent runs. Migrations are checksummed with SHA-256, can be filtered by environment and run in dry-run mode.
ENGINEERING EVIDENCE
- Integration tests run against real PostgreSQL through Testcontainers, and CI and release workflows are set up.
- Published to npm as @ujjwaljain16/migratedb (v1.0.1). About 327 downloads over its lifetime.
DECISIONS & INVESTIGATIONS
The lock row remained after the kill.
Reproduced on 1.0.1 with SQLite: files 01_c (DEPENDS: 03_a), 02_b and 03_a were applied as 03_a, 01_c, 02_b.
WHAT ISN'T DONE
- The source repository is currently private; only the npm package is public.
- MySQL and SQLite adapters exist but are not tested. The lock has no stale-lock timeout, so a killed run needs the lock row deleted by hand, and a SQLite-only install fails looking for the pg module.
- Database drivers are peer dependencies that recent npm versions install automatically, so "zero dependencies" only describes direct dependencies.
STACK
- TypeScript
- Node.js
- PostgreSQL
- MySQL
- SQLite
- Testcontainers