Skip to content

Releases: fightingBald/database-migration-erd

v0.2.1: Database Migration ERD — repository rename and publication fixes

Choose a tag to compare

@fightingBald fightingBald released this 24 Sep 18:35

Database Migration ERD now consistently uses the renamed repository and website: fightingBald/database-migration-erd. This patch fixes package metadata and documentation URLs; parsing and layout behavior are unchanged.

Install

Requires Python 3.11+, pipx and D2 0.7.1 on PATH:

pipx install https://github.com/fightingBald/database-migration-erd/releases/download/v0.2.1/migration_erd-0.2.1-py3-none-any.whl
migration-erd ./migrations ./schema.svg

The package/command remains migration-erd; python -m erd_generator and embedding under tools/erd-generator/ remain supported.

Changes

  • Correct the homepage, source, documentation and issue URLs in the distribution, README, website, sitemap and sharing metadata.
  • State the SQL boundary clearly: the current parser uses the PostgreSQL dialect. Compatible SQL from other databases can work; full MySQL, SQLite and SQL Server migration support is not verified. ORM migration source code is not an input format.
  • Add publication regression checks and a focused bug report form. Website PRs validate links and metadata without deploying; main deploys. Code CI retains Python 3.11/3.14 rendering coverage and skips documentation-only changes.

The 64-table fictional showcase remains pinned to v0.2.0, which generated the published measurements. Existing assets have not been replaced.

Project website · SQL support and integration

v0.2.0: Database Migration ERD — installable CLI and compact cluster layouts

Choose a tag to compare

@fightingBald fightingBald released this 24 Sep 17:54

Database Migration ERD turns PostgreSQL migration SQL into readable SVG ER diagrams without a database connection. This release adds an installable CLI and measured cluster layout refinement for larger schemas.

Install

Requires Python 3.11+, pipx and D2 0.7.1 on PATH:

pipx install https://github.com/fightingBald/database-migration-erd/releases/download/v0.2.0/migration_erd-0.2.0-py3-none-any.whl
migration-erd ./migrations ./schema.svg

The existing python -m erd_generator entry point and copying the runtime under tools/erd-generator/ remain supported.

What stands out

  • Local migration parsing: forward schema changes, sql-migrate/goose Up sections, supported dollar-quoted DO blocks, and ERD-neutral setup commands.
  • Automatic grouping, colours, independent cluster placement and cross-group FK routing on top of D2/ELK; optional TALA support.
  • Column types, composite/self-referencing foreign keys and index descriptions; optional YAML relationships and group overrides.
  • SVG-only default output, in-memory candidate layouts, terminal-only diagnostics and preservation of the previous SVG on errors.

Reproducible layout example

Attached dummy-64.sql is fully fictional: 64 tables, 551 columns, 69 FKs and six automatically inferred groups. No layout YAML or manual positions are used. Compared with the tool's own native D2 baseline, the default result has 40.1% less canvas area and a 22.1% shorter longest connection. Distinct crossing locations rise from 3 to 12. This is one documented tradeoff, not a benchmark against other tools or a universal improvement guarantee.

See layout-before.svg, layout-after.svg and layout-metrics.json; PNG previews and SHA256SUMS are included. Full-size SVGs are best viewed in a browser.

Project website and workflow comparison · Developer guide and SQL limitations

This tool consumes supported SQL migrations. It does not apply migrations, execute procedural code, or replace database introspection for structures created through unsupported dynamic SQL.

v0.1.0: Forward-only migration diagrams

Choose a tag to compare

@fightingBald fightingBald released this 21 Sep 16:17

PostgreSQL migrations can now generate forward-only ER diagrams from sql-migrate/goose Up sections and separate .up.sql files. Rollback sections and .down.sql files are skipped, preventing rollback DDL from silently removing tables, columns, indexes or relationships from the diagram.

  • Direction markers inside strings, dollar-quoted blocks, comments and SQL routine bodies stay literal. Ambiguous directions produce diagnostics with original file line numbers.
  • Existing plain SQL, partial previews and the direct codegen entrypoint are preserved. No new command-line options or runtime dependencies.
  • The attached PNG and SVG show an entirely fictional library: 16 tables, 15 foreign keys and four automatically inferred groups. Generated with the default command and D2 0.7.1/ELK, without layout overrides.

Regenerate existing diagrams after upgrading. The preview images are Release assets; generated SQL and diagrams are not included in the Git tree.

Validation: 548 tests passed, including real D2/ELK rendering; Python compilation, Ruff checks and formatting passed. The attached SVG passed table, grouping and FK geometry checks, and its PNG was visually inspected.