DEV Community

Adelodun Peter
Adelodun Peter

Posted on

🚀 Stop Fighting Alembic — FastAPI & Flask Migrations Can Finally Be as Simple as Django.

If you’ve ever tried setting up Alembic, you probably went through this cycle:

  • create a migrations folder
  • edit alembic.ini
  • modify env.py
  • manually import your models
  • configure database URLs
  • hope it works

And when it finally runs, you pray nothing breaks when you update your models again.

I hated this.
Every FastAPI / Flask / SQLAlchemy developer I know hates this.
So I built something to fix it.

Introducing Migrator — A Zero-Config Migration CLI for Python

Migrator brings Django-like migrations to FastAPI and Flask.

No configuration.
No boilerplate.
No Alembic headaches.

Just migrations that work.

❌ Before Migrator: Alembic Setup Pain

Traditional Alembic workflow:
alembic init migrations

  • edit alembic.ini
  • edit env.py
  • import models, configure engine
  • hope it works

If you've done it, you know how fragile this is.

✅ After Migrator: Pure Simplicity

migrator init
migrator makemigrations "initial"
migrator migrate

That’s it. No configs. No patches. No manual imports. It just works.

🔍 How Migrator Works

✔️ Finds your models automatically
✔️ Detects your database engine
✔️ Builds migration environment
✔️ Wires Alembic automatically
✔️ Runs safe schema diffs

This means you keep the power of Alembic, without any of the setup.

🎉 Why Migrator Rocks

  • Zero configuration
  • Auto-discovery of models & metadata
  • Framework-agnostic (FastAPI, Flask, Django, SQLAlchemy)
  • Django-like workflow
  • Production-ready (powered by Alembic)

🧪 Quick Start

Install:

curl -sSL https://raw.githubusercontent.com/Adelodunpeter25/migrator/main/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Initialize:

migrator init
Enter fullscreen mode Exit fullscreen mode

Create first migration:

migrator makemigrations "initial"
Enter fullscreen mode Exit fullscreen mode

Apply:

migrator migrate
Enter fullscreen mode Exit fullscreen mode

Done.

💬 Final Thoughts

Python needed a migration tool like this.

FastAPI and Flask are amazing frameworks — but Alembic setup has always been a huge barrier for beginners and even experienced devs.

Migrator removes the friction so you can focus on building, not fighting config files.

If you want migrations that work like Django, without switching ecosystems, give Migrator a try.

GitHubPyPIDocs

I would love feedback, suggestions, and contributors, this is just the beginning.

Happy coding!

Top comments (0)