finds.dev

tortoise/aerich

A database migrations tool for TortoiseORM, ready to production.

View on GitHubHomepage ↗

★ 1,084PythonApache-2.0updated Nov 2026

// the take

Aerich is the migrations tool for TortoiseORM, filling the same role Alembic plays for SQLAlchemy — autogenerate migrations from model changes, apply/rollback them, and inspect existing databases into models. It's for teams already committed to TortoiseORM who need schema versioning across MySQL, Postgres, and SQLite.

Multi-backend DDL handling (MySQL/Postgres/SQLite) is implemented per-backend rather than one generic SQL layer, which shows in the dedicated ddl/ and inspectdb/ subpackages. The --fake flag for marking migrations applied without running SQL is a real operational need (syncing environments, hotfixing drift) that a lot of smaller migration tools skip. It's also usable as a library via the Command class, not just a CLI, so it can be driven from application startup code or custom tooling. Test coverage for edge cases is unusually thorough — m2m field renames, recursive m2m, FK ordering, constraint removal, and per-app migration layouts all have dedicated test fixtures.

The README opens with a warning that tortoise-orm>=1.0.0 now ships its own built-in migration CLI and points users there instead — that's the project telling you its long-term future is uncertain. Column rename detection is a heuristic guess that prompts you to confirm at migration-generation time; get it wrong (or run non-interactively) and you silently drop-and-recreate the column, losing data. The documented recovery path when aerich itself breaks is to drop the aerich tracking table and delete the migrations directory and start over — that's discarding migration history, not a real repair mechanism. inspectdb explicitly can't infer foreign keys or enum fields, so reverse-engineering an existing schema still needs manual cleanup before it's usable.

We read the README, the directory tree and a key source file in November 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,084
Forks
113
Language
Python
License
Apache-2.0
Last commit
1 Nov 2026

// nearby

If aerich isn't quite it.

All repos →