Supported database

PostgreSQL schema diagrams from migrations

Run your migrations on a real PostgreSQL 10, 11, 12, 13, 14, 15, 16, 17, 18 in Docker and get the resulting schema as an SVG. 22 migration tools can draw on PostgreSQL.

Versions

Pass the version as the version field with databaseType=POSTGRESQL. Each one is a stock image, started fresh for every drawing.

VersionImage
10postgres:10
11postgres:11
12postgres:12
13postgres:13
14postgres:14
15postgres:15
16postgres:16
17postgres:17
18postgres:18

What the diagram shows on PostgreSQL

Tables land in the public schema. Type names are the internal ones PostgreSQL reports: int4 for INTEGER, int8 for BIGINT, bpchar for CHAR, timestamptz for TIMESTAMP WITH TIME ZONE.

The types are the names the engine's JDBC metadata reports, without lengths: an integer column reads int4, a short text varchar, a calendar date date. Tables are read from public; the migration tool's own bookkeeping table is left out.

Migration tools that draw on PostgreSQL

petclinic on postgresql 18
ER diagram of the PetClinic schema drawn by SchemaDrawer on PostgreSQL 18

The PetClinic sample, drawn from Flyway migrations on PostgreSQL 18. Open the SVG.

Run it

Draw on PostgreSQL 18

The same request works for every tool; only migrationType and the files change.

curl -X POST https://schemadrawer.com/api/v1/drawing \
  -H "Request-Id: $(uuidgen)" \
  -F "userId=5f0c1d2e-3a4b-4c5d-8e6f-7a8b9c0d1e2f" \
  -F "migrationType=FLYWAY" \
  -F "databaseType=POSTGRESQL" \
  -F "version=18" \
  -F "files=@db/migration/V1__create_owners_and_pets.sql" \
  -F "files=@db/migration/V2__create_vets.sql" \
  -F "files=@db/migration/V3__create_visits.sql"
# {"jobId":"0b6e2f4c-8d1a-4c3e-9f7a-2a5b6c7d8e9f"}
- uses: schemadrawercom/action@v1
  with:
    sql-directory: db/migration
    output-path: docs/schema-diagram.svg
    migration-type: FLYWAY
    database-type: POSTGRESQL
    database-version: '18'
    github-token: ${{ secrets.GITHUB_TOKEN }}
From the blog

Reading about PostgreSQL

Draw your PostgreSQL schema now

Upload the migration directory, pick the version you deploy to, get an SVG back.