Skip to content

Commit d59f7ae

Browse files
docs: add sample pull request for updating database schema diagram
1 parent 7405a53 commit d59f7ae

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,19 @@ The service deploys two containers (which both use the same image/Python environ
136136
* The `apscheduler` job scheduler
137137

138138
# Database Schema Diagram Update
139-
When the database models are changed, the database schema diagram in `db_diagram.svg` should be updated to reflect the changes.
139+
When the database models are changed, the database schema diagram in [`db_diagram.svg`](./db_diagram.svg) should be updated to reflect the changes.
140140

141-
### Prerequisites
142-
- `graphviz` (install via Homebrew on macOS: `brew install graphviz`)
141+
### Generating the Database Schema Diagram
142+
143+
1. The `aai-backend/scripts/generate_db_diagram.py` script generates a database schema diagram from the SQLAlchemy models defined in the codebase, when a models are added, removed, or modified, the `models` module should be updated accordingly.
144+
145+
1. To generate an updated database schema diagram, run the following command:
146+
147+
```shell
148+
uv generate_db_diagram.sh
149+
```
150+
151+
The updated diagram will be saved in [`db_diagram.svg`](./db_diagram.svg).
143152

144153

145154
### Generating the Diagram

0 commit comments

Comments
 (0)