Support for Many-to-many Relationships

dbdocs now supports Many-to-many Relationships!

When drawing the many-to-many relationship, you no longer need to create an associative (join) table. Instead, just define it directly, such as:

Table books {
  id int [pk]
  ...
}

Table authors {
  id int [pk]
  ...
}

Ref books_authors: books.id <> authors.id // many-to-many

For more DBML syntax updates, please check out our docs!

From dbdocs team with :heart:

Often the associative table has its own attributes, in that case, the table would have to be defined explicitly.

1 Like

Yes, you are correct. That is why we backed both scenarios. You can also use two 1-n relationships and an associative table to document the n-n relationships.