Hi Duy,
I have sometime to draft up a more detail version comparing to previous suggestion
My current workflow
I store all the diagram in a git repo to work with my team (for code review and versoning stuff)
.
|_ docs
| |_ db
| |_ overall_erd.dbml
| |_ full_erd.dbml
| |_ *.dbml
|_ REAME.md
But git cannot display the diagram, therefore I have to clone all the diagram to dbdiagram app
My diagrams
|_ overall_erd.dbml
|_ full_erd.dbml
|_ *.dbml
Other team member can checkout the git repo and again clone the necessary diagram to their dbdiagram app
Draw backs
Multiple tools are required to track the changes
If I want to update the diagram, I have to do either of below
- update in dbdiagram app copy to git file
- update git file and copy to dbdiagram app
It’s not easy to collaborate with the team using dbdiagram app
It’s reasonable if team collaboration is the main goal for the future and has a potential to become a business model
but I wonder if there’s a way to adapt with some other platform out there (github or gitlab) for community version perhaps
Only the owner of the diagram can edit
Because of this dbdiagram app cannot be used as a serious knowledge base (wiki) for team. That’s why I have to use git
No version control in dbdiagram app
Diagram is code based therefore each update has to be reviewed and controlled. That’s why I have to use git
Suggestions
Below are very opinionated suggestions from my perspective but I think it’s worth mentioning
1. Integrate with git system
a. Ability to display dbml files or embedded dbml block code in markdown
Gitlab & Plantuml has achieved similar workflow: https://docs.gitlab.com/ee/administration/integration/plantuml.html
Cons
- Need to setup a separated server for rendering
2. Dbdiagram app
a. Import dbml from git repo or file server/local folder
All dbml files will be scanned and diagrams will be automatically created for each dbml files
Example when import a git repo like this
.
|_ docs
| |_ db
| |_ overall_erd.dbml
| |_ full_erd.dbml
| |_ *.dbml
|_ REAME.md
We will have below diagrams
My diagrams
|_ overall_erd.dbml
|_ full_erd.dbml
|_ *.dbml
Existed diagrams will be overriden (with a warning of course) on each import
Cons
- just a convenient method to import multiple dbml files still far from a robust system for team collaboration
b. Use git as a backend to store diagrams
All dbml files will be scanned and diagrams will be automatically created for each dbml files (like above demonstration)
- When files in git system are updated, diagram should also be be updated
- This is the important feature of this workflow
- When diagrams are updated, git files should also be updated
- In my opinion, this is a nice to have feature
- I’m ok if diagram UI is just read only when link with git system
Cons
- Though we don’t need to setup a separate server for rendering like other suggestion, we have to use dbdiagram app instead of just using git UI