A lightweight CLI tool that detects out-of-sync databases and prevents commits when developers forget to run migrations. msync ensures that local development databases stay synchronized with reference environments, eliminating "it works on my machine but not work on server :)" issues.
Backend teams waste 2-3 hours per week on database synchronization issues:
- New columns exist in code but not in local database
- New hires spend hours debugging missing tables
- CI failures due to schema drift
- Onboarding takes days instead of hours
msync automates database migration synchronization by:
- Detecting your current migration version
- Comparing against production or team reference databases
- Blocking commits when out of sync
- Providing clear commands to resolve drift
| Feature |
|---|
| CLI status check |
| Schema diff visualization |
Migration apply (up) |
| Pre-commit hook |
| CI verification mode |
| Multiple adapter support |
msync supports major migration frameworks across multiple languages:
| Framework | Language |
|---|---|
| Alembic (SQLAlchemy) | Python |
| Rails ActiveRecord | Ruby |
| Django Migrations | Python |
| Prisma Migrate | TypeScript |
git clone https://github.com/Melphins/msync.git
cd msync
./install.shPowerShell
git clone https://github.com/Melphins/msync.git
cd msync
.\install.ps1# In your project directory, run the init wizard
msync init
# Follow the interactive prompts to configure your adapters and targets
# Check sync status
msync status --target production
# Apply pending migrations
msync up --target production
# See what would change
msync diff --target production
# CI/CD verification (exits with code based on status)
msync verify --target productionThe msync init command provides an interactive wizard to generate your .msync.yml configuration file. The configuration defines:
- Local database adapter and connection
- Target environment(s) to sync against
- Thresholds for warnings and errors
- Pre-commit hook settings
Install the pre-commit hook to automatically verify database sync before each commit:
msync install-hookThe hook will check your database against the target and prevent commits when out of sync. Configure hook behavior in .msync.yml. Use git commit --no-verify to bypass the check when necessary.
msync is available on all major platforms:
| Platform |
|---|
| Linux |
| macOS |
| Windows |
| WSL |
msync follows a clean architecture with adapter pattern implementation:
- Adapter Registry: Factory-based adapter loading for extensibility
- Configuration System: YAML-based with environment variable substitution
- Transaction Safety: Each migration runs in its own transaction
- Dry-run Support: Preview changes before applying
- CI/CD Ready: Exit codes and JSON output for automation
MIT License - see LICENSE file for details.