Mermaid ERDs ignore foreign key nullability
Atlas renders every foreign key as optional on the referenced-table side of Mermaid ER diagrams, including foreign keys whose referencing columns are NOT NULL.
For example, a required relationship currently renders as:
children }o--o| parentsThe required relationship should render as:
children }o--|| parentsNullable foreign keys should continue to render as zero-or-one. For composite foreign keys, the relationship remains optional when any referencing column is nullable.
I prepared a small fix with coverage for required and optional single-column and composite foreign keys. The scoped linters and full CLI race-test suite pass:
https://github.com/HaukeSchnau/atlas/commit/c8b54962d4e5efad46e9f434ccb1e028047cce43
The repository currently restricts pull requests to collaborators, so I could not open a PR. Is this cardinality behavior intentional? If not, I’m happy for a maintainer to cherry-pick the commit or advise how you prefer to receive the change.
Source: ariga/atlas