-
Notifications
You must be signed in to change notification settings - Fork 59
Description
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
and DailySchedule
found in this link:
model DailySchedule {
id Int @id @default(autoincrement())
day String
startTime String
endTime String
schedule Schedule @relation(fields: [scheduleId], references: [id])
scheduleId Int
}
model Schedule {
id Int @id @default(autoincrement())
name String
timezone String
dailySchedules DailySchedule[]
owner User @relation(fields: [ownerId], references: [id])
ownerId Int
Meeting Meeting[]
}
The ER diagram generated for this schema, which can be found here, shows two lines between Schedule
and DailySchedule
:
- A one-to-many line from
Schedule
toDailySchedule
(accurate), labelled "schedule". - An extra many-to-many line between
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.