-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnecessary Many-to-Many Relation Lines in ER Diagram #219
Comments
What this is currently sending to mermaid is... erDiagram
"DailySchedule" {
Int id "🗝️"
String day
String startTime
String endTime
}
"Schedule" {
Int id "🗝️"
String name
String timezone
}
"DailySchedule" o|--|| "Schedule" : "schedule"
"Schedule" o{--}o "DailySchedule" : "dailySchedules"
The part in question
Relationship syntax should show that there should be exactly one "Schedule" to zero to many "DailySchedules" ignoring the generator it should be outputting as follows
which would come back with... erDiagram
"DailySchedule" {
Int id "🗝️"
String day
String startTime
String endTime
}
"Schedule" {
Int id "🗝️"
String name
String timezone
}
"DailySchedule" o{--|| "Schedule" : "schedule"
"Schedule" ||--}o "DailySchedule" : "dailySchedules"
To remove/replace having both directions would have to be an additional feature. Somewhere in this issue list, there was a request to include both sides of the relationship because of the labeling having different meanings in each direction. But the relationships should be the same, which is why this is a bug. Unable to take a look now but happy to review a PR if you find it before I do |
Thank you for your response. I've tried to look into the code and find a way to fix this issue, but it seems quite challenging to resolve it quickly. I kindly ask you to consider revisiting this for a correction when you have some spare time. |
@keonik would you mind show how to combining relationship names from both model in to one connection string? |
Sorry about that. I've been out on vacation for a week. I'll pick this back up when I can. I left off getting the connection names correctly but some oddness with the relationship lines not showing up properly for the many to x instances. |
🎉 This issue has been resolved in version 1.12.0-alpha.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The alpha version seems to work well, any plan to release in non alpha ? |
It's been so long since I've checked but the last I saw on alpha was that the many-to-many relationships were still not working in all test cases. I'll give this a look tonight. Appreciate the ping! Sorry, I haven't been able to dedicate as much time to this. |
Hello,
I've encountered an issue concerning the representation of relations between tables in the generated diagram.
In my schema, I have many models with various relations between them. The problem arises when two tables have a relation; it seems that the tool always draws an extra line representing a many-to-many relationship, in addition to the one that represents the actual relationship defined in the schema. This effectively doubles the number of lines in the diagram, leading to a lot of unnecessary clutter and making it difficult to read and understand.
As an example, consider the following schema involving
Schedule
andDailySchedule
found in this link:The ER diagram generated for this schema, which can be found here, shows two lines between
Schedule
andDailySchedule
:Schedule
toDailySchedule
(accurate), labelled "schedule".Schedule
andDailySchedule
(not present in the schema), labelled "dailySchedules".The second line, representing a many-to-many relationship that doesn't exist in the schema, is unnecessary and confusing.
I've looked through the existing issues and couldn't find a similar problem reported. Therefore, I am wondering if there's a way to prevent these unnecessary lines from being drawn or if this is a potential area for enhancement in the tool.
Thank you for your time and your work on this project.
The text was updated successfully, but these errors were encountered: