You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/syntax/entityRelationshipDiagram.md
+28
Original file line number
Diff line number
Diff line change
@@ -198,6 +198,34 @@ erDiagram
198
198
199
199
The `type` values must begin with an alphabetic character and may contain digits, hyphens, underscores, parentheses and square brackets. The `name` values follow a similar format to `type`, but may start with an asterisk as another option to indicate an attribute is a primary key. Other than that, there are no restrictions, and there is no implicit set of valid data types.
200
200
201
+
### Entity Name Aliases (v\<MERMAID_RELEASE_VERSION>+)
202
+
203
+
An alias can be added to an entity using square brackets. If provided, the alias will be showed in the diagram instead of the entity name.
204
+
205
+
```mermaid-example
206
+
erDiagram
207
+
p[Person] {
208
+
string firstName
209
+
string lastName
210
+
}
211
+
a["Customer Account"] {
212
+
string email
213
+
}
214
+
p ||--o| a : has
215
+
```
216
+
217
+
```mermaid
218
+
erDiagram
219
+
p[Person] {
220
+
string firstName
221
+
string lastName
222
+
}
223
+
a["Customer Account"] {
224
+
string email
225
+
}
226
+
p ||--o| a : has
227
+
```
228
+
201
229
#### Attribute Keys and Comments
202
230
203
231
Attributes may also have a `key` or comment defined. Keys can be `PK`, `FK` or `UK`, for Primary Key, Foreign Key or Unique Key. To specify multiple key constraints on a single attribute, separate them with a comma (e.g., `PK, FK`).. A `comment` is defined by double quotes at the end of an attribute. Comments themselves cannot have double-quote characters in them.
Copy file name to clipboardExpand all lines: packages/mermaid/src/docs/syntax/entityRelationshipDiagram.md
+16
Original file line number
Diff line number
Diff line change
@@ -144,6 +144,22 @@ erDiagram
144
144
145
145
The `type` values must begin with an alphabetic character and may contain digits, hyphens, underscores, parentheses and square brackets. The `name` values follow a similar format to `type`, but may start with an asterisk as another option to indicate an attribute is a primary key. Other than that, there are no restrictions, and there is no implicit set of valid data types.
146
146
147
+
### Entity Name Aliases (v<MERMAID_RELEASE_VERSION>+)
148
+
149
+
An alias can be added to an entity using square brackets. If provided, the alias will be showed in the diagram instead of the entity name.
150
+
151
+
```mermaid-example
152
+
erDiagram
153
+
p[Person] {
154
+
string firstName
155
+
string lastName
156
+
}
157
+
a["Customer Account"] {
158
+
string email
159
+
}
160
+
p ||--o| a : has
161
+
```
162
+
147
163
#### Attribute Keys and Comments
148
164
149
165
Attributes may also have a `key` or comment defined. Keys can be `PK`, `FK` or `UK`, for Primary Key, Foreign Key or Unique Key. To specify multiple key constraints on a single attribute, separate them with a comma (e.g., `PK, FK`).. A `comment` is defined by double quotes at the end of an attribute. Comments themselves cannot have double-quote characters in them.
0 commit comments