"Zero or many" cardinality support and explicit minimum/maximum values

While dbdiagram.io is a great tool and so far it has been a really useful tool for me, the lack of support for the “zero or many” cardinality in relationships has been a bit troubling for me.

Lets say we have 2 tables:
image
(i dont have users.id as a pk due to what i mentioned here)

My objective is to represent that a user can have 0 or many posts and that 0 or many posts were done by a user.

As you can see, in the diagram, it only displays 0..1 (since it’s the default behaviour), and based off of the relation only, you couldn’t infer that its a “0 or many” on the posts side of the relationship.

Hence, a way to optionally make the 0 side of a relationship have a max value of “many” would be apreciated, to make the relationships more complete. Here’s an example of how this could be implemented, for this specific case:

//sets max value to "many" instead of the default "one"
table users{
  id int [increment, ref: -* posts.id_user]
}

table posts{
  id int [pk, increment]
  id_user int
}

//OR

Ref: posts.id_user -* users.id //max "many" value applies to the fk, posts.id_user

The default minimum and maximum values would be the same, preventing databases from breaking, but the visual would change to the standard way in crow’s foot notation - the inner component represents the minimum, while the outer one the maximum:

image

Currently, the default values for a given relationship would be:

  • one-to-x: min 1, max 1
  • many-to-x: min 1, max *
  • zero-to-x: min 0, max 1