From 26e9b1790b46a020e0160d6b1667204e85c78da1 Mon Sep 17 00:00:00 2001 From: Tom PERRILLAT-COLLOMB Date: Tue, 24 Jan 2023 21:20:11 +0100 Subject: [PATCH 1/3] feat(er): allow multiple constraints on attributes little changes in grammar to get a list of constraints (PK, FK or UK), so little changes in renderer to handle this list --- demos/er.html | 14 ++++++++++++++ packages/mermaid/src/diagrams/er/erRenderer.js | 7 +++++-- .../src/diagrams/er/parser/erDiagram.jison | 11 +++++++++-- .../src/diagrams/er/parser/erDiagram.spec.js | 16 ++++++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/demos/er.html b/demos/er.html index 34e06acf8..347eb5e13 100644 --- a/demos/er.html +++ b/demos/er.html @@ -71,6 +71,20 @@
+
+      erDiagram
+        "HOSPITAL" {
+          int id PK
+          int doctor_id PK,FK
+          string address UK
+          string name
+          string phone_number
+          string fax_number
+        }
+      
+
+