diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000..6a45073
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,25 @@
+name: Parsing or layout problem
+description: Report a reproducible SQL, rendering or installation problem.
+body:
+ - type: textarea
+ id: environment
+ attributes:
+ label: Versions and environment
+ description: Include migration-erd --version, d2 --version, Python version and operating system.
+ validations:
+ required: true
+ - type: textarea
+ id: reproduction
+ attributes:
+ label: Command and minimal input
+ description: Include the command, database dialect, and a small fictional SQL example. Remove company data, credentials and private paths. For layout issues, attach the resulting SVG if possible.
+ render: text
+ validations:
+ required: true
+ - type: textarea
+ id: result
+ attributes:
+ label: Expected and actual result
+ description: Describe the difference and include relevant terminal errors.
+ validations:
+ required: true
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index fdc0d4d..9477924 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -1,6 +1,30 @@
name: Check ERD generation
-on: [push, pull_request]
+on:
+ workflow_dispatch:
+ push:
+ branches: [main]
+ paths:
+ - "erd_generator/**"
+ - "tests/**"
+ - "requirements*.txt"
+ - "pyproject.toml"
+ - "MANIFEST.in"
+ - "Makefile"
+ - ".github/workflows/check.yml"
+ pull_request:
+ paths:
+ - "erd_generator/**"
+ - "tests/**"
+ - "requirements*.txt"
+ - "pyproject.toml"
+ - "MANIFEST.in"
+ - "Makefile"
+ - ".github/workflows/check.yml"
+
+concurrency:
+ group: check-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
permissions:
contents: read
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index 718f3a5..20259da 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -2,17 +2,31 @@ name: Publish project website
on:
workflow_dispatch:
+ pull_request:
+ paths:
+ - "site/**"
+ - "README.md"
+ - "dev_guide.md"
+ - "pyproject.toml"
+ - "erd_generator/__init__.py"
+ - "tests/unit/test_publication.py"
+ - ".github/workflows/pages.yml"
push:
branches: [main]
paths:
- "site/**"
+ - "README.md"
+ - "dev_guide.md"
+ - "pyproject.toml"
+ - "erd_generator/__init__.py"
+ - "tests/unit/test_publication.py"
- ".github/workflows/pages.yml"
permissions:
contents: read
concurrency:
- group: pages
+ group: pages-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false
jobs:
@@ -22,8 +36,16 @@ jobs:
steps:
- uses: actions/checkout@v7.0.1
with:
- ref: main
persist-credentials: false
+ - uses: actions/setup-python@v7.0.0
+ with:
+ python-version: "3.11"
+ cache: pip
+ cache-dependency-path: requirements*.txt
+ - name: Check public URLs and metadata
+ run: |
+ python -m pip install -r requirements-dev.txt
+ python -m pytest -q tests/unit/test_publication.py
- name: Fetch versioned illustration assets
env:
GH_TOKEN: ${{ github.token }}
@@ -34,10 +56,13 @@ jobs:
test -s site/assets/layout-after.svg
test -s site/assets/layout-before.svg
- uses: actions/configure-pages@v6.0.0
+ if: github.event_name != 'pull_request'
- uses: actions/upload-pages-artifact@v5.0.0
+ if: github.event_name != 'pull_request'
with:
path: site/
deploy:
+ if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 5
diff --git a/README.md b/README.md
index 865ec64..0207b6b 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
-# Migration ERD
+# Database Migration ERD
-**Readable PostgreSQL ER diagrams from migration SQL. No database connection required.**
+**Readable ER diagrams from database migration SQL. No database connection required.**
-[](https://github.com/fightingBald/database_migrate_UML_generator/releases/download/v0.2.0/layout-after.svg)
+[](https://github.com/fightingBald/database-migration-erd/releases/download/v0.2.0/layout-after.svg)
-64 dummy tables, six automatically inferred groups, default settings. [Before/after and tool comparison](https://fightingbald.github.io/database_migrate_UML_generator/) · [Download SVG](https://github.com/fightingBald/database_migrate_UML_generator/releases/download/v0.2.0/layout-after.svg)
+64 dummy tables, six automatically inferred groups, default settings. [Before/after and tool comparison](https://fightingbald.github.io/database-migration-erd/) · [Download SVG](https://github.com/fightingBald/database-migration-erd/releases/download/v0.2.0/layout-after.svg)
## Why use it?
@@ -13,14 +13,14 @@
- **Migration-aware input:** forward SQL changes, sql-migrate/goose Up sections and supported dollar-quoted `DO` blocks, processed locally without executing SQL.
- **Fits codegen and CI:** one command, SVG-only output by default, meaningful exit codes and previous SVG preserved on failure.
-Use it when migration files are your input and an automatically arranged ER diagram is your output. It does not apply migrations or model every PostgreSQL feature; see [SQL support](https://github.com/fightingBald/database_migrate_UML_generator/blob/main/dev_guide.md#sql-support-and-diagnostics).
+**SQL support:** the parser currently uses the PostgreSQL dialect. Compatible SQL from other databases may work, but full MySQL, SQLite and SQL Server migration support is not verified. It reads SQL files, not ORM migration code, and never applies migrations. See [supported SQL and limitations](https://github.com/fightingBald/database-migration-erd/blob/main/dev_guide.md#sql-support-and-diagnostics).
## Install
Requires **Python 3.11+**, [pipx](https://pipx.pypa.io/stable/installation/) and [D2 0.7.1](https://github.com/d2lang/d2/releases/tag/v0.7.1) on PATH. Install the versioned package from GitHub Releases:
```bash
-pipx install https://github.com/fightingBald/database_migrate_UML_generator/releases/download/v0.2.0/migration_erd-0.2.0-py3-none-any.whl
+pipx install https://github.com/fightingBald/database-migration-erd/releases/download/v0.2.1/migration_erd-0.2.1-py3-none-any.whl
```
## Usage
@@ -37,9 +37,11 @@ Errors appear in the terminal, with a nonzero exit code and the previous SVG pre
| Option | Purpose |
| --- | --- |
-| `--fk-config file.yaml` | [Add relationships](https://github.com/fightingBald/database_migrate_UML_generator/blob/main/dev_guide.md#relationships-without-database-fk-constraints). |
-| `--layout-config file.yaml` | [Set groups, titles and colours](https://github.com/fightingBald/database_migrate_UML_generator/blob/main/dev_guide.md#business-layout). |
-| `--layout tala` | [Use TALA](https://github.com/fightingBald/database_migrate_UML_generator/blob/main/dev_guide.md#optional-tala-layout). |
+| `--fk-config file.yaml` | [Add relationships](https://github.com/fightingBald/database-migration-erd/blob/main/dev_guide.md#relationships-without-database-fk-constraints). |
+| `--layout-config file.yaml` | [Set groups, titles and colours](https://github.com/fightingBald/database-migration-erd/blob/main/dev_guide.md#business-layout). |
+| `--layout tala` | [Use TALA](https://github.com/fightingBald/database-migration-erd/blob/main/dev_guide.md#optional-tala-layout). |
| `--show-references` | Label cross-group FK targets beside fields. |
-Run `migration-erd --help` for all options. The [developer guide](https://github.com/fightingBald/database_migrate_UML_generator/blob/main/dev_guide.md) covers source installation, copying into `tools/erd-generator/`, CI and development. `python -m erd_generator` remains available.
+Run `migration-erd --help` for all options. The [developer guide](https://github.com/fightingBald/database-migration-erd/blob/main/dev_guide.md) covers source installation, copying into `tools/erd-generator/`, CI and development. `python -m erd_generator` remains available.
+
+Found a parsing or layout problem? [Report it with a small fictional SQL example](https://github.com/fightingBald/database-migration-erd/issues/new?template=bug_report.yml).
diff --git a/dev_guide.md b/dev_guide.md
index aa16729..6c5ce41 100644
--- a/dev_guide.md
+++ b/dev_guide.md
@@ -93,6 +93,8 @@ Intermediate layouts stay in memory; only final publication uses an atomic stagi
## SQL support and diagnostics
+The project accepts SQL migration files rather than a specific migration framework. Its tokenizer, parser and SQL normalization currently use the PostgreSQL dialect; there is no dialect selector. Common SQL from other databases can be compatible, but that is not a guarantee for their complete migration syntax. MySQL backtick-quoted DDL and SQL Server bracket-quoted DDL with `GO` fail in current checks. SQLite-style `CREATE TABLE` can parse, but SQLite-specific migration behavior is not fully validated. ORM migration source code must first be exported to SQL.
+
Inputs are UTF-8. `V