Updating the ERD¶
This page outlines how to view, edit, and propose changes to the People Depot entity relationship diagram (ERD), which is managed using dbdiagram.io.
📌 Purpose¶
To ensure database schema edits are collaborative, auditable, and synchronized with the source of truth, all edits must go through GitHub via a structured process described below.
🔍 Viewing the Live ERD¶
To view the current version of the ERD:
- Visit: Live ERD (dbdiagram.io) → link
Note
📝 You do not need an account to view the ERD
✏️ How to Propose Changes to the ERD¶
All edits must be submitted via pull request using the steps below.
-
Fork the Repository
- Navigate to the People Depot GitHub repo
- Click Fork
Note
Ensure your fork is up-to-date before making changes
-
Copy the Schema Source
- Locate the file:
schema.dbml
in the root folder - Copy the entire contents of the file
- Locate the file:
-
Make edits on dbdiagram.io (Your Account)
- Sign in to dbdiagram.io using your own free account
- Create a new diagram
- Paste the contents of
schema.dbml
into the editor - Make your proposed changes using DBML syntax
- Ensure the diagram renders correctly
-
Export Updated Schema
- Once edits are complete and validated visually:
- Click Export
- Choose DBML
- Save the file as
schema.dbml
- Once edits are complete and validated visually:
-
Commit & Push Changes
- In your forked repo:
- Replace the original
schema.dbml
file with your updated version - Commit your changes with a descriptive message (e.g.,
Add table for program milestones
) - Push to your fork
- Replace the original
- In your forked repo:
-
Submit a Pull Request
- Open a PR from your fork to the
main
branch ofPeopleDepot
- Title your PR descriptively (e.g.,
Update ERD to include new Program table
) - In the PR body, explain:
- What you changed
- Why you changed it
- Anything reviewers should double-check (e.g., table relationships, naming consistency)
- Open a PR from your fork to the
✅ After Your PR Is Merged¶
Once your PR is approved and merged:
- A maintainer will manually update the official ERD on dbdiagram.io under the
PeopleDepot@hackforla.org
account using your submittedschema.dbml
file. - The Live ERD link will reflect your changes shortly after.
Note
You will not be given access to the shared dbdiagram.io account.
All official updates are uploaded by maintainers.
🛠 Tips and Conventions¶
- Use clear, singular table names (e.g.,
Person
, notPeople
) - Always define primary keys and foreign keys
- Maintain consistent naming conventions (e.g.,
snake_case
orcamelCase
, as established) - Include comments in DBML for any complex relationships or logic