TLDR; Migrata is a CLI that lets you inspect, diff, and apply changes using plain SQL. It's like Terraform, but for your database.
I built this tool because of the pain I experienced working with migration files at my job. These databases are shared across many teams and even more applications.
Like many organizations, we follow a file-based migration approach: a folder for each change set, files with targeted changes per component, all tracked in Git. There are strict processes for approvals and promotions. The problem is that this approach results in thousands of migration files piling up over time. To mitigate this, we have a change approval board whose sole job is to coordinate with database admins to apply these scripts.
Most of their time is spent understanding what's changing and if there are any conflicts. It's not uncommon for two separate scripts from different change sets to modify the same things. Centralizing these changes would drastically lower the time needed to review and approve them.
After working with Terraform for years, I knew there were better ways to track state and apply changes. But unlike the cloud, databases already have a schema language to describe their state: plain SQL. Instead of inventing a new DSL, my tool treats your SQL schema as the source of truth and diffs against it directly.
In practice, this gives you the best of both worlds: readable SQL and a declarative schema, with each component defined once. Changes are centralized, not scattered across layers of migration files.
I've been working on this particular project for the past 17 months on evenings and weekends, and finally feel like it's at a state where it's good enough to share
Core Feature:
- Comparing two schema sources and generating a clear diff
- See exactly what will change before anything is applied
- Manually approve and apply changes
How it works:
- Run the "inspect" command to inspect your live database schema and sync it to your local file system.
- This does deliberate scans on your target schemas; no psql dumps needed.
- Make a single or multiple changes in your local editor
- Run the "diff" command to detect differences and generate a plan in the console.
- Internally, we build up a dependency graph so we know how and when to apply a change and who's affected.
- Manually approve and apply changes
Features:
- Better Diffs
- This tool shows the user modifications and query plans side-by-side. You always know where a change is coming from and why. Traceability is paramount
- Impact Analysis:
- The diff includes a list of downstream components affected by a change
- Risk Classification:
- Every planned migration is labeled Safe, Warning, or Destructive so you can assess impact at a glance. Warnings and destructive changes are summarized separately with counts.
- Full column lifecycle management:
- Changes to columns are analyzed, and safe multi-step patterns are used to transform columns. Indexes & constraints are always preserved after changes
- Custom Organization:
- You can organize your schema locally however you like (single file or deeply nested directories). It loads everything and automatically builds a dependency graph no matter how you organize your schemas
- Local Validation:
- The tool will spin up an ephemeral database in docker where it can execute the migration plan before running against your live database.
- Advisory Locks:
- Concurrent migration protection using PostgreSQL advisory locks
Security Features:
- No email or account required to use it
- Fully Local (No LLM's or calls to third-party services)
- Privacy-first (your schema never leaves your computer)
Who's this for:
- Anyone who values working with declarative workflows
- Developers who prefer working with plain SQL because they need full control
- Teams with databases shared across multiple applications and languages
What's in it for me:
This is a free tool to use without any account or limits. My goal is to build a tool that's so useful, that it would be a no-brainer to adopt into your stack. The end goal is to get adopted by businesses who use this tool and want to pay for advanced auditing, governance, and collaboration features.
Wait, isn't this just like the atlas cli?
Yes, this is a direct competitor to the tool, except I don't believe in gating critical features behind paywalls. Better tooling means fewer outages and safer deployments for everyone.
If you want to know more about what sets migrata apart, I've written a whole blog post outlining the high-level differences:
https://migrata.io/blog/migrata-vs-atlas
Here’s the site if you want to learn more:
https://migrata.io
And if you want to learn more about me, you can visit the about page, where I have my background and links to my personal LinkedIn and Github Profile. I'm proud to stand behind my work
https://migrata.io/about