Skip to content

Unnecessary Many-to-Many Relation Lines in ER Diagram #219

@mrsekut

Description

@mrsekut

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:

image

  1. A one-to-many line from Schedule to DailySchedule (accurate), labelled "schedule".
  2. An extra many-to-many line between Schedule and DailySchedule (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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions