$npx skillfedfor your agent

django-pg-migration-tools

Tools for making Django migrations safer and more scalable.

With conditionsPyPI DatabaseReleased Feb 202676.2K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — django_pg_migration_tools-0.1.26-py3-none-any.whl
v0.1.26 · released 2026-02-27 · Python >=3.10

Yes, if you run Django on PostgreSQL and perform schema migrations on live databases. The package directly addresses a real production pain point—long-running migrations that lock tables—and is actively maintained with no external dependencies. The alpha status reflects early releases, but the core operations are straightforward and well-documented. Install if you need safer schema changes; skip if you use a different database backend or have no production migration concerns.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Django and PostgreSQL; operations are PostgreSQL-specific and will not work with other database backends.
  • Low friction installation with no runtime dependencies.
  • Actively maintained as of 2026-02-27 with recent releases.

License · maintenance · safety

permissive license (permissive) — BSD 3-Clause License permits commercial and private use with minimal restrictions; you may modify and distribute freely provided you retain copyright notices and disclaimers.

last release 2026-02-27 (168 days) · last repo commit 2026-02-27 · 61 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 76,180 downloads/mo, #14,650 on PyPI

Verify before relying

pip install django-pg-migration-tools

from django_pg_migration_tools.operations import SaferAddIndexConcurrently

class Migration(migrations.Migration):
    operations = [
        SaferAddIndexConcurrently(
            model_name='mymodel',
            index=models.Index(fields=['field_name'])
        )
    ]
  • Minimum Django version requirement not specified in fact sheet.
  • Whether all operations are backward-compatible with existing migration files.
  • Performance impact of safer operations compared to standard Django migrations.
Same gist for agents: .md · .json

What it is and what it does

django-pg-migration-tools is a Django package that wraps PostgreSQL-specific migration operations to make schema changes safer in production environments. It provides drop-in replacements for standard Django migration operations—adding/removing constraints, indexes, and foreign keys—that use PostgreSQL's non-blocking techniques (like concurrent index creation) and timeout controls to prevent migrations from locking tables and blocking application traffic.

The package includes management commands to run migrations with configurable statement and lock timeouts, and context managers to apply timeouts to arbitrary database operations. It's designed for teams running Django on PostgreSQL who need to perform schema changes on live databases without downtime or long-running locks. The codebase is actively maintained, supports modern Python versions, and carries no runtime dependencies beyond Django itself.

Use it for

  • Add indexes to large production tables without blocking reads and writes during the migration window.
  • Add or remove unique and check constraints safely using PostgreSQL's non-blocking constraint creation.
  • Set columns to NOT NULL on populated tables by validating data before applying the constraint.
  • Run all migrations with automatic statement and lock timeouts to prevent runaway queries from blocking the application.
  • Add foreign keys to existing tables with validation and optional constraint deferral.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you run Django on PostgreSQL and perform schema migrations on live databases.

The package directly addresses a real production pain point—long-running migrations that lock tables—and is actively maintained with no external dependencies. The alpha status reflects early releases, but the core operations are straightforward and well-documented. Install if you need safer schema changes; skip if you use a different database backend or have no production migration concerns.

Install

django-pg-migration-tools on PyPI

Before you install

Low friction installation with no runtime dependencies. Actively maintained as of 2026-02-27 with recent releases. Supports current Python versions (3.10 through 3.14).

Requires Django and PostgreSQL; operations are PostgreSQL-specific and will not work with other database backends.

License in practice

BSD 3-Clause License permits commercial and private use with minimal restrictions; you may modify and distribute freely provided you retain copyright notices and disclaimers.

Quickstart

pip install django-pg-migration-tools

from django_pg_migration_tools.operations import SaferAddIndexConcurrently

class Migration(migrations.Migration):
    operations = [
        SaferAddIndexConcurrently(
            model_name='mymodel',
            index=models.Index(fields=['field_name'])
        )
    ]

Verify before relying

  • Minimum Django version requirement not specified in fact sheet.
  • Whether all operations are backward-compatible with existing migration files.
  • Performance impact of safer operations compared to standard Django migrations.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 168 days since the last release
Last repo commit
First released
Downloads76,180 / month, #14,650 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Evidence: django_pg_migration_tools-0.1.26-py3-none-any.whl

Tags

Capabilities
django postgres migration safetyconcurrent index operations djangopostgres constraint migrationsdjango migration timeoutssafer database schema changespostgres lock timeout managementdjango migration best practices
Topics
django-ormpostgres-specificschema-migration

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “concurrent index operations django”

Give your agent the search over MCP, or paste the wish link into any chat.

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.

Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.

Install it if you need to connect Python applications to YDB databases.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.

Install it if you need to manipulate, format, or analyze SQL text programmatically.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also django-pg-zero-downtime-migrations · django-postgres-extra · django-pgmigrate · squawk-cli · django-pglock · django-safemigrate · django-pgviews-redux · migra · yoyo-migrations · django-syzygy