peewee-migrate
Support for migrations in Peewee ORM
What it is and what it does
Peewee Migrate is a migration management tool for Peewee ORM that handles database schema versioning through timestamped migration files. It works by storing migration state in your database and applying or rolling back changes in order, supporting both automatic schema detection and manual migration writing.
You can use it either as a command-line tool (pw_migrate) or programmatically via the Router class. The package handles the common workflow of creating new migrations, running pending migrations, and rolling back applied migrations. It integrates with click for CLI functionality and depends only on peewee itself, keeping the dependency footprint minimal.
Use it for:
- Track and version database schema changes across development, staging, and production environments.
- Automatically generate migration files by scanning model definitions for changes.
- Roll back failed migrations or revert to earlier schema versions when needed.
- Manage migrations for Peewee-based applications without manual SQL scripting.
- Integrate migrations into deployment pipelines via the command-line interface.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Peewee Migrate provides a command-line and programmatic interface for creating, running, and rolling back database migrations for Peewee ORM applications.
Yes. Peewee Migrate is actively maintained, has no known vulnerabilities, and provides a straightforward migration workflow for Peewee ORM users. The low install friction and permissive MIT license make it a practical choice for projects using Peewee. Install it if you need reliable schema versioning for a Peewee application.
Install
peewee-migrate on PyPI
pip
pip install peewee-migrateuv
uv add peewee-migratepoetry
poetry add peewee-migrateInstalling peewee-migrate
Before you install
Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent release and no known vulnerabilities. Requires peewee >= 3.10 and Python >= 3.10.
License in practice
MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute the package freely provided you include the license notice.
Quickstart
pip install peewee-migrate
from peewee_migrate import Router
from peewee import SqliteDatabase
router = Router(SqliteDatabase('test.db'))
router.create('migration_name')
router.run()
Requires peewee >= 3.10 and Python >= 3.10; migration files must define a migrate() function in the migrations directory.
Verify before relying
- Whether autodiscovery of model changes works reliably across all project structures and import patterns.
- Performance characteristics when managing large numbers of migrations or complex schema changes.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — peewee, click |
| Maintenance | actively maintained — 155 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 229,713/month — #9,125 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: peewee_migrate-1.15.0-py3-none-any.whl
Keywords: peewee, migrations, orm
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
peeweePeewee is a lightweight ORM that maps Python…
unclear · top 1,000 on PyPI
yoyo-migrationsYoyo-migrations is a database schema migration…
permissive · top 15,000 on PyPI
Flask-MigrateFlask-Migrate handles SQLAlchemy database…
permissive · top 5,000 on PyPI
aerichAerich is a database migration tool for…
permissive · top 15,000 on PyPI
sqlite-migrateA compatibility shim that re-exports the…
permissive · top 15,000 on PyPI
django-test-migrationsTests Django schema and data migrations,…
permissive · top 15,000 on PyPI
sqlalchemy-migrateProvides database schema migration management…
permissive · top 15,000 on PyPI
Flask-AlembicFlask-Alembic integrates Alembic database…
permissive · top 15,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
mongodb-migrationsManages schema migrations for MongoDB databases…
copyleft · top 15,000 on PyPI