Share SchemaSpy database docs
Every team has a schema question queue, and it is answered by the same
two people, from memory. What is orders.status_v2 for? Which table
actually holds the current address? Is that foreign key still enforced?
SchemaSpy answers all of these mechanically — a page per table, relationship diagrams, constraint and orphan analysis — and produces a directory of HTML that lands wherever the job ran.
Publish it
java -jar schemaspy.jar \
-t pgsql -db "$DB" -host "$HOST" -u "$DB_USER" \
-o ./schema-docs
Drag schema-docs/ into the app:
index.html becomes the report body, and the per-table pages, diagrams
and CSS upload as assets with their references rewritten to the uploaded
copies. Publishing the index alone gives you a contents page whose links
go nowhere.
For CI, PATCH the same report id after each regeneration:
curl -fsS -X PATCH \
"https://commareports.com/api/v1/reports/$COMMA_REPORT_ID" \
-H "Authorization: Bearer $COMMA_API_TOKEN" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile html ./schema-docs/index.html \
--arg title "Schema — $DB — $(date +%F)" \
'{title: $title, html: $html}')"