Skip to content

Releases: postgresql-tools/migra

v1.7.2

Choose a tag to compare

@github-actions github-actions released this 09 Jun 01:28
Bump version to 1.7.2, use PEP 621 [project] table for PyPI metadata

v1.5.2

Choose a tag to compare

@github-actions github-actions released this 05 Jun 16:05
3e05327
Merge pull request #3 from migradiff/multi-language_readme_docs

This PR adds multi-language support to MigraDiff's documentation and introduces a new Licensing section with a transparent Business License model.

v1.5.1

Choose a tag to compare

@github-actions github-actions released this 04 Jun 18:24
fix: add permissions for GitHub release creation

v1.5.0 — COMMENT ON Support

Choose a tag to compare

@leochong leochong released this 02 Jun 02:58

MigraDiff now diffs COMMENT ON metadata across all major PostgreSQL object types — tables, columns, views, materialized views, functions, sequences, types, indexes, constraints, and schemas.

Why this matters

If you store schema documentation, AI context, or compliance metadata in COMMENT ON blocks, MigraDiff no longer silently drops it during migrations. Added, changed, and removed comments all generate the correct COMMENT ON (or COMMENT ON ... IS NULL) SQL.

AI integration

--explain and --generate now read your COMMENT ON metadata as schema context. The AI knows not just that a column is text, but what it's for — richer explanations, more accurate generated migrations.

Works everywhere

  • Live connections: queries pg_catalog.pg_description directly
  • --from-file mode: works automatically with pg_dump output
  • --output json: all comment changes classified as safe risk

190 tests passing. No new dependencies.

pip install --upgrade migradiff

v1.4.0 — The Complete AI Migration Assistant

Choose a tag to compare

@leochong leochong released this 01 Jun 14:30

MigraDiff v1.4.0 turns the PostgreSQL schema-diff tool into a complete
AI-powered migration assistant. Four schema-aware AI flags, all optional —
the core diff engine stays dependency-free.

Added

  • --explain — plain-English explanation of any migration
  • --rollback — generates a reversal migration for a given diff
  • --advise — deterministic + AI risk assessment of a migration
  • --generate — writes a migration from a plain-English description,
    using your real table names and column types from a
    live connection or schema file

Safety

  • --generate hard-refuses bulk-destructive requests ("drop all",
    "wipe", etc.) before any API call is made
  • Soft-warns and flags individual destructive operations
  • All AI output is marked as AI-generated; temperature 0 for determinism
  • --generate is combinable with --advise for immediate risk feedback

175 tests passing. AI features require an Anthropic API key:

pip install migradiff[ai]

v1.3.0 — AI-Powered Migration Explanation & Migrations Folder Support

Choose a tag to compare

@leochong leochong released this 30 May 15:28

Install

pip install --upgrade migradiff

What's New

AI-Powered Migration Explanation (--explain)

MigraDiff can now explain any migration in plain English — what
each change does, what risks it carries, and safer alternatives
for destructive operations.

pip install migradiff[ai]
migra --setup-ai
migra --explain postgres://db_a postgres://db_b

Powered by Claude Haiku (Anthropic). Bring your own API key —
no data is sent to MigraDiff servers. Works with --output json,
--from-file, --from-migrations-dir, and all existing flags.

Migrations Folder Input Mode (--from-migrations-dir)

Diff a directory of numbered migration files against a base
schema without requiring a live branch database.

migra --from-migrations-dir ./supabase/migrations \
  postgres://db_production

Supports Supabase timestamp format, Flyway versioned format,
and standard numeric prefixes. Files applied in correct numeric
sort order (9 before 10, not lexicographic).

Also in this release

  • Naming clarification in README — CLI stays migra for backward
    compatibility, package is migradiff

Full changelog: https://github.com/migradiff/migra/blob/main/CHANGELOG.md

Upgrading

pip install --upgrade migradiff

migradiff v1.2.0 — the maintained migra fork now has destructive DDL safety rails

Choose a tag to compare

@leochong leochong released this 29 May 23:21

Quick update on the migradiff fork (maintained continuation of
the deprecated djrobstep/migra).

v1.2.0 is out: pip install --upgrade migradiff

The headline feature: --safe mode is now on by default. If a
generated migration contains DROP TABLE, DROP COLUMN, or other
destructive operations, the tool halts with exit code 1 and
tells you exactly what it found. Use --force-destructive to
proceed when you're sure.

Also added smart column rename detection — when a DROP COLUMN
and ADD COLUMN of the same type appear on the same table,
migradiff asks if you meant to rename it instead. Saves a lot
of accidental data loss.

Other additions: enum evolution diffing (ADD VALUE for safe
additions, DROP+recreate for removals), domain diffing, and
the codebase now has zero flake8 warnings for the first time.

Full changelog: https://github.com/migradiff/migra/blob/main/CHANGELOG.md

v1.1.0 — First public release

Choose a tag to compare

@leochong leochong released this 29 May 18:21

First public release of MigraDiff, the actively maintained fork of djrobstep/migra.

pip install migradiff

Drop-in replacement — CLI interface and output format unchanged from the original migra.

Fixed

  • Python 3.12+ deprecation warnings resolved
  • --schema flag edge cases in multi-schema deployments
  • RLS policy diffing — CREATE/DROP POLICY, partition table support, equality comparison bug
  • 6 test fixture mismatches from schemainspect version drift

Added

  • --from-file — diff pg_dump -s schema files without a live database connection
  • --output json — structured diff output with per-statement risk classification (safe / warning / destructive)
  • docker-compose.yml — one-command local dev environment
  • Dockerfile and official Docker image
  • GitHub Actions action with fail_on_destructive support
  • Pre-commit hook

Upgrading from djrobstep/migra

pip uninstall migra
pip install migradiff

Full changelog: https://github.com/migradiff/migra/blob/main/CHANGELOG.md