Add automated database schema diagram generation#186
Conversation
Co-authored-by: DevSecNinja <14926452+DevSecNinja@users.noreply.github.com>
Co-authored-by: DevSecNinja <14926452+DevSecNinja@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #186 +/- ##
=======================================
Coverage 71.82% 71.82%
=======================================
Files 11 11
Lines 802 802
Branches 124 124
=======================================
Hits 576 576
Misses 163 163
Partials 63 63
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds automated generation of a visual SQLite database schema diagram as a GitHub Actions artifact, and documents where to find it in the architecture docs.
Changes:
- Introduces a new GitHub Actions workflow to initialize the SQLite schema from SQLAlchemy models and generate a PNG diagram via SchemaCrawler.
- Uploads the generated diagram as a GitHub Actions artifact (90-day retention).
- Updates architecture documentation to reference the new workflow and artifact location.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
ARCHITECTURE.md |
Adds a note pointing readers to the schema-diagram workflow and its generated artifact. |
.github/workflows/schema-diagram.yml |
New workflow to build a SQLite DB schema and generate/upload a SchemaCrawler PNG diagram. |
.github/workflows/schema-diagram.yml
Outdated
| run: | | ||
| mkdir -p data | ||
| python -c " | ||
| from app.models import init_db | ||
| init_db() | ||
| print('Database initialized with schema') | ||
| " |
There was a problem hiding this comment.
This workflow adds an inline multi-line run: | script. Repo guidance in .github/copilot-instructions.md (Workflow Scripts section) requires multi-line workflow scripts to be extracted into files under .github/scripts/ for maintainability/testability. Consider moving the DB-init logic into a dedicated script (or reuse an existing one) and invoke it here.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds GitHub Actions workflow to automatically generate visual database schema diagrams using SchemaCrawler.
Implementation
Workflow (
.github/workflows/schema-diagram.yml):init_db()schemacrawler/SchemaCrawler-Action@v16.22.2backend/app/models/**), PRs, pushes to main, manual dispatchDocumentation (
ARCHITECTURE.md):Artifact Access
Download
database-schema-diagramfrom Actions tab → workflow run → Artifacts section.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.