Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple key constraints on a single attribute #51

Closed
lnschroeder opened this issue Oct 16, 2023 · 1 comment · Fixed by #52
Closed

Support multiple key constraints on a single attribute #51

lnschroeder opened this issue Oct 16, 2023 · 1 comment · Fixed by #52

Comments

@lnschroeder
Copy link
Contributor

lnschroeder commented Oct 16, 2023

When a column is a primary key and foreign key at the same time, only the PK constraint will be shown, even though mermaid supports PK,FK inside the constraint column:

erDiagram
    CAR ||--o{ NAMED-DRIVER : allows
    CAR {
        string registrationNumber PK
        string make
        string model
    }
    PERSON ||--o{ NAMED-DRIVER : is
    PERSON {
        string driversLicense PK "The license #"
        string name
    }
    NAMED-DRIVER {
        string carRegistrationNumber PK, FK
        string driverLicence PK, FK
    }
Loading

I will create a PR, as this is a necessary feature to start with the PR for #43.

KarnerTh pushed a commit that referenced this issue Nov 18, 2023
* Support multiple key constraints on a single attribute (#51)

* Add unique constraint to key column (#43)

* Relationship labels (#50)

* Adds relationship label types and parser

* Lookup label based on pk and fk names; overrides omitting the label and the constraint label

* First full working version

* Use a map for faster lookup

* Fix example labels

* Adds comments for label regex

* Adds basic tests for relationship label map

* Support multiple key constraints on a single attribute (#51) (#52)

* Add unique constraint to key column (#43)

---------

Co-authored-by: Dan Goslen <dwgoslen@gmail.com>
@KarnerTh
Copy link
Owner

Now available in version 0.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants