samchon / prisma-markdown

Markdown generator of Prisma, including ERD and descriptions
MIT License
393 stars 18 forks source link

Support an implicit many-to-many relations #6

Closed yubrot closed 10 months ago

yubrot commented 10 months ago

This is a good tool. Thank you! As of now, it seems that implicit m-n-relations are not illustrated, it would be good to support it as well.

model Post {
  id         Int        @id @default(autoincrement())
  title      String
  categories Category[]
}

model Category {
  id    Int    @id @default(autoincrement())
  name  String
  posts Post[]
}

image

samchon commented 10 months ago

Oh, I hadn't known that prisma starts supporing implicit M: N relationship.

By the way, generated schema is extremely ugly. I'll support this feature, but recommend not to use it.

image

samchon commented 10 months ago

Upgrade to v1.0.3, then be supported.

yubrot commented 10 months ago

Thank you for the quick response!

samchon commented 10 months ago

@yubrot Upgrade to v1.0.4.

Previous version has a bug that misunderstanding self-recursive 1: N relationship as implicit M: N relationship.

Therefore, previous version may draw non-existing table and diagram for that.