skillfed

peewee-migrate

Support for migrations in Peewee ORM

peewee-migrate v1.15.0 229.7K downloads/30d#9,125 on PyPI379
Permissive license MIT Active released

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-migrate

uv

uv add peewee-migrate

poetry

poetry add peewee-migrate

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Tags

peewee database migrationsorm migration tooldatabase schema versioningpeewee migration cliautomatic schema generationdatabase rollback managementpeewee migration engine
database-migrationspeewee-ormschema-versioning

More Python Modules packages