mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
68.63k stars 6.05k forks source link

[ER Diagram] Allow omitting the type of an attribute #5563

Open michaelschufi opened 3 weeks ago

michaelschufi commented 3 weeks ago

Proposal

For prototyping, I would like to omit the attribute's type in my ER Diagrams. This can very well be an implementation detail and is often not important for the initial discussion of the entities and their relationships.

Example

Let users omit the type altogether.

erDiagram
    CUSTOMER ||--o{ ORDER : places
    CUSTOMER {
        name
        custNumber
        sector
    }
    ORDER ||--|{ LINE-ITEM : contains
    ORDER {
        orderNumber
        deliveryAddress
    }
    LINE-ITEM {
        productCode
        quantity
        pricePerUnit
    }

and/or allow an _ or similar to specify that the type should be omitted.

erDiagram
    CAR ||--o{ NAMED-DRIVER : allows
    CAR {
        _ registrationNumber PK
        _ make
        _ model
        _ parts
    }
    PERSON ||--o{ NAMED-DRIVER : is
    PERSON {
        _ driversLicense PK "The license #"
        _ firstName "Only 99 characters are allowed"
        _ lastName
        _ phone UK
        _ age
    }
    NAMED-DRIVER {
        _ carRegistrationNumber PK, FK
        _ driverLicence PK, FK
    }
    MANUFACTURER only one to zero or more CAR : makes

Screenshots

If no type is specified for every attribute of an entity, do not render the type table column.