after merge with remote
authorBenjamin Auder <benjamin.auder@somewhere>
Mon, 12 Feb 2018 19:09:15 +0000 (20:09 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Mon, 12 Feb 2018 19:09:15 +0000 (20:09 +0100)
.gitignore
example_MCD.svg [new file with mode: 0644]
example_MLD.svg [new file with mode: 0644]
parser.js
tata [new file with mode: 0644]

index 1377554..6b59895 100644 (file)
@@ -1 +1,3 @@
 *.swp
+#index.html for local tests
+index.html
diff --git a/example_MCD.svg b/example_MCD.svg
new file mode 100644 (file)
index 0000000..4d6c1a1
--- /dev/null
@@ -0,0 +1,86 @@
+<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
+
+<!-- Generated by graphviz version 2.40.1 (20161225.0304)
+ -->
+<!-- Title: %3 Pages: 1 -->
+<svg width="352pt" height="246pt" viewBox="0.00 0.00 352.00 246.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 242)">
+<title>%3</title>
+<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-242 348,-242 348,4 -4,4"></polygon>
+<!-- Musician -->
+<g id="node1" class="node">
+<title>Musician</title>
+<polygon fill="#ae7d4e" stroke="transparent" points="122.5,-207.5 122.5,-232.5 194.5,-232.5 194.5,-207.5 122.5,-207.5"></polygon>
+<text text-anchor="start" x="127.5" y="-216.3" font-family="Roboto" font-size="14.00" fill="#ffffff">Musician</text>
+<polygon fill="#ffffff" stroke="transparent" points="122.5,-182.5 122.5,-207.5 194.5,-207.5 194.5,-182.5 122.5,-182.5"></polygon>
+<text text-anchor="start" x="127.5" y="-192.3" font-family="Roboto" text-decoration="underline" font-size="14.00" fill="#000000">id</text>
+<polygon fill="#ffffff" stroke="transparent" points="122.5,-157.5 122.5,-182.5 194.5,-182.5 194.5,-157.5 122.5,-157.5"></polygon>
+<text text-anchor="start" x="127.5" y="-166.3" font-family="Roboto" font-size="14.00" fill="#000000">name</text>
+<polygon fill="#ffffff" stroke="transparent" points="122.5,-132.5 122.5,-157.5 194.5,-157.5 194.5,-132.5 122.5,-132.5"></polygon>
+<text text-anchor="start" x="127.5" y="-141.3" font-family="Roboto" font-size="14.00" fill="#000000">band</text>
+<polygon fill="#ffffff" stroke="transparent" points="122.5,-107.5 122.5,-132.5 194.5,-132.5 194.5,-107.5 122.5,-107.5"></polygon>
+<text text-anchor="start" x="127.5" y="-116.3" font-family="Roboto" font-size="14.00" fill="#000000">role</text>
+<polygon fill="none" stroke="#000000" points="121.5,-107 121.5,-234 195.5,-234 195.5,-107 121.5,-107"></polygon>
+</g>
+<!-- Play -->
+<g id="node5" class="node">
+<title>Play</title>
+<path fill="none" stroke="#d3d3d3" d="M330.5,-149.5C330.5,-149.5 284.5,-149.5 284.5,-149.5 278.5,-149.5 272.5,-143.5 272.5,-137.5 272.5,-137.5 272.5,-123.5 272.5,-123.5 272.5,-117.5 278.5,-111.5 284.5,-111.5 284.5,-111.5 330.5,-111.5 330.5,-111.5 336.5,-111.5 342.5,-117.5 342.5,-123.5 342.5,-123.5 342.5,-137.5 342.5,-137.5 342.5,-143.5 336.5,-149.5 330.5,-149.5"></path>
+<text text-anchor="middle" x="307.5" y="-134.3" font-family="Roboto" font-size="14.00" fill="#000000">&lt;Play&gt;</text>
+<text text-anchor="middle" x="307.5" y="-119.3" font-family="Roboto" font-size="14.00" fill="#000000">event</text>
+</g>
+<!-- Musician&#45;&#45;Play -->
+<g id="edge4" class="edge">
+<title>Musician:name--Play</title>
+<path fill="none" stroke="#000000" d="M195.7146,-160.5095C219.1602,-154.2154 249.2436,-146.1393 272.2952,-139.9509"></path>
+<text text-anchor="middle" x="241.5" y="-154.3" font-family="Roboto" font-size="14.00" fill="#000000">1,n</text>
+</g>
+<!-- Instrument -->
+<g id="node2" class="node">
+<title>Instrument</title>
+<polygon fill="#ae7d4e" stroke="transparent" points="114.5,-54.5 114.5,-79.5 203.5,-79.5 203.5,-54.5 114.5,-54.5"></polygon>
+<text text-anchor="start" x="119.5" y="-63.3" font-family="Roboto" font-size="14.00" fill="#ffffff">Instrument</text>
+<polygon fill="#ffffff" stroke="transparent" points="114.5,-29.5 114.5,-54.5 203.5,-54.5 203.5,-29.5 114.5,-29.5"></polygon>
+<text text-anchor="start" x="119.5" y="-39.3" font-family="Roboto" text-decoration="underline" font-size="14.00" fill="#000000">name</text>
+<polygon fill="#ffffff" stroke="transparent" points="114.5,-4.5 114.5,-29.5 203.5,-29.5 203.5,-4.5 114.5,-4.5"></polygon>
+<text text-anchor="start" x="119.5" y="-13.3" font-family="Roboto" font-size="14.00" fill="#000000">family</text>
+<polygon fill="none" stroke="#000000" points="113,-4 113,-81 204,-81 204,-4 113,-4"></polygon>
+</g>
+<!-- Guitar -->
+<g id="node4" class="node">
+<title>Guitar</title>
+<polygon fill="#ae7d4e" stroke="transparent" points="280.5,-42.5 280.5,-67.5 335.5,-67.5 335.5,-42.5 280.5,-42.5"></polygon>
+<text text-anchor="start" x="285.5" y="-51.3" font-family="Roboto" font-size="14.00" fill="#ffffff">Guitar</text>
+<polygon fill="#ffffff" stroke="transparent" points="280.5,-17.5 280.5,-42.5 335.5,-42.5 335.5,-17.5 280.5,-17.5"></polygon>
+<text text-anchor="start" x="285.5" y="-26.3" font-family="Roboto" font-size="14.00" fill="#000000">type</text>
+<polygon fill="none" stroke="#000000" points="279,-16.5 279,-68.5 336,-68.5 336,-16.5 279,-16.5"></polygon>
+</g>
+<!-- Instrument&#45;&#45;Guitar -->
+<g id="edge2" class="edge">
+<title>Instrument:name--Guitar:name</title>
+<path fill="none" stroke="#000000" stroke-dasharray="5,2" d="M214.2241,-42.5C236.1496,-42.5 260.3961,-42.5 278.672,-42.5"></path>
+<polygon fill="#000000" stroke="#000000" points="204.0145,-42.5 214.0146,-38.0001 209.0145,-42.5 214.0145,-42.5001 214.0145,-42.5001 214.0145,-42.5001 209.0145,-42.5 214.0145,-47.0001 204.0145,-42.5 204.0145,-42.5"></polygon>
+</g>
+<!-- Instrument&#45;&#45;Play -->
+<g id="edge3" class="edge">
+<title>Instrument:name--Play</title>
+<path fill="none" stroke="#000000" d="M204.0145,-69.3811C226.9506,-82.9272 254.2291,-99.038 275.0199,-111.3171"></path>
+<text text-anchor="middle" x="241.5" y="-100.3" font-family="Roboto" font-size="14.00" fill="#000000">0,n</text>
+</g>
+<!-- Piano -->
+<g id="node3" class="node">
+<title>Piano</title>
+<polygon fill="#ae7d4e" stroke="transparent" points="9,-42.5 9,-67.5 59,-67.5 59,-42.5 9,-42.5"></polygon>
+<text text-anchor="start" x="14" y="-51.3" font-family="Roboto" font-size="14.00" fill="#ffffff">Piano</text>
+<polygon fill="#ffffff" stroke="transparent" points="9,-17.5 9,-42.5 59,-42.5 59,-17.5 9,-17.5"></polygon>
+<text text-anchor="start" x="14" y="-26.3" font-family="Roboto" font-size="14.00" fill="#000000">type</text>
+<polygon fill="none" stroke="#000000" points="8,-16.5 8,-68.5 60,-68.5 60,-16.5 8,-16.5"></polygon>
+</g>
+<!-- Piano&#45;&#45;Instrument -->
+<g id="edge1" class="edge">
+<title>Piano:name--Instrument:name</title>
+<path fill="none" stroke="#000000" stroke-dasharray="5,2" d="M60.0993,-42.5C72.4972,-42.5 87.8228,-42.5 102.6578,-42.5"></path>
+<polygon fill="#000000" stroke="#000000" points="112.8078,-42.5 102.8078,-47.0001 107.8078,-42.5 102.8078,-42.5001 102.8078,-42.5001 102.8078,-42.5001 107.8078,-42.5 102.8077,-38.0001 112.8078,-42.5 112.8078,-42.5"></polygon>
+</g>
+</g>
+</svg>
diff --git a/example_MLD.svg b/example_MLD.svg
new file mode 100644 (file)
index 0000000..4f03c96
--- /dev/null
@@ -0,0 +1,96 @@
+<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
+
+<!-- Generated by graphviz version 2.40.1 (20161225.0304)
+ -->
+<!-- Title: %3 Pages: 1 -->
+<svg width="495pt" height="272pt" viewBox="0.00 0.00 495.00 272.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 268)">
+<title>%3</title>
+<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-268 491,-268 491,4 -4,4"></polygon>
+<!-- Instrument -->
+<g id="node1" class="node">
+<title>Instrument</title>
+<polygon fill="#ae7d4e" stroke="transparent" points="213.5,-80.5 213.5,-105.5 302.5,-105.5 302.5,-80.5 213.5,-80.5"></polygon>
+<text text-anchor="start" x="218.5" y="-89.3" font-family="Roboto" font-size="14.00" fill="#ffffff">Instrument</text>
+<polygon fill="#ffffff" stroke="transparent" points="213.5,-55.5 213.5,-80.5 302.5,-80.5 302.5,-55.5 213.5,-55.5"></polygon>
+<text text-anchor="start" x="218.5" y="-65.3" font-family="Roboto" text-decoration="underline" font-size="14.00" fill="#000000">name</text>
+<polygon fill="#ffffff" stroke="transparent" points="213.5,-30.5 213.5,-55.5 302.5,-55.5 302.5,-30.5 213.5,-30.5"></polygon>
+<text text-anchor="start" x="218.5" y="-39.3" font-family="Roboto" font-size="14.00" fill="#000000">family</text>
+<polygon fill="none" stroke="#000000" points="212,-30 212,-107 303,-107 303,-30 212,-30"></polygon>
+</g>
+<!-- Guitar -->
+<g id="node2" class="node">
+<title>Guitar</title>
+<polygon fill="#ae7d4e" stroke="transparent" points="356,-157.5 356,-182.5 478,-182.5 478,-157.5 356,-157.5"></polygon>
+<text text-anchor="start" x="394.5" y="-166.3" font-family="Roboto" font-size="14.00" fill="#ffffff">Guitar</text>
+<polygon fill="#ffffff" stroke="transparent" points="356,-132.5 356,-157.5 478,-157.5 478,-132.5 356,-132.5"></polygon>
+<text text-anchor="start" x="361" y="-141.3" font-family="Roboto" font-size="14.00" fill="#000000">type</text>
+<polygon fill="#ffffff" stroke="transparent" points="356,-107.5 356,-132.5 478,-132.5 478,-107.5 356,-107.5"></polygon>
+<text text-anchor="start" x="361" y="-117.3" font-family="Roboto" text-decoration="underline" font-size="14.00" fill="#000000">#Instrument_id</text>
+<polygon fill="none" stroke="#000000" points="355,-107 355,-184 479,-184 479,-107 355,-107"></polygon>
+</g>
+<!-- Instrument&#45;&#45;Guitar -->
+<g id="edge1" class="edge">
+<title>Instrument:name--Guitar:Instrument_id</title>
+<path fill="none" stroke="#000000" d="M302.5,-67.5C332.5502,-67.5 324.8404,-110.207 347.8106,-118.2146"></path>
+<ellipse fill="#000000" stroke="#000000" cx="352.0484" cy="-118.8797" rx="4" ry="4"></ellipse>
+</g>
+<!-- Piano -->
+<g id="node3" class="node">
+<title>Piano</title>
+<polygon fill="#ae7d4e" stroke="transparent" points="356,-54.5 356,-79.5 478,-79.5 478,-54.5 356,-54.5"></polygon>
+<text text-anchor="start" x="397" y="-63.3" font-family="Roboto" font-size="14.00" fill="#ffffff">Piano</text>
+<polygon fill="#ffffff" stroke="transparent" points="356,-29.5 356,-54.5 478,-54.5 478,-29.5 356,-29.5"></polygon>
+<text text-anchor="start" x="361" y="-38.3" font-family="Roboto" font-size="14.00" fill="#000000">type</text>
+<polygon fill="#ffffff" stroke="transparent" points="356,-4.5 356,-29.5 478,-29.5 478,-4.5 356,-4.5"></polygon>
+<text text-anchor="start" x="361" y="-14.3" font-family="Roboto" text-decoration="underline" font-size="14.00" fill="#000000">#Instrument_id</text>
+<polygon fill="none" stroke="#000000" points="355,-4 355,-81 479,-81 479,-4 355,-4"></polygon>
+</g>
+<!-- Instrument&#45;&#45;Piano -->
+<g id="edge2" class="edge">
+<title>Instrument:name--Piano:Instrument_id</title>
+<path fill="none" stroke="#000000" d="M302.5,-67.5C332.2708,-67.5 325.0412,-25.6143 347.8744,-17.7607"></path>
+<ellipse fill="#000000" stroke="#000000" cx="352.0473" cy="-17.1133" rx="4" ry="4"></ellipse>
+</g>
+<!-- Musician -->
+<g id="node4" class="node">
+<title>Musician</title>
+<polygon fill="#ae7d4e" stroke="transparent" points="221.5,-233.5 221.5,-258.5 293.5,-258.5 293.5,-233.5 221.5,-233.5"></polygon>
+<text text-anchor="start" x="226.5" y="-242.3" font-family="Roboto" font-size="14.00" fill="#ffffff">Musician</text>
+<polygon fill="#ffffff" stroke="transparent" points="221.5,-208.5 221.5,-233.5 293.5,-233.5 293.5,-208.5 221.5,-208.5"></polygon>
+<text text-anchor="start" x="226.5" y="-218.3" font-family="Roboto" text-decoration="underline" font-size="14.00" fill="#000000">id</text>
+<polygon fill="#ffffff" stroke="transparent" points="221.5,-183.5 221.5,-208.5 293.5,-208.5 293.5,-183.5 221.5,-183.5"></polygon>
+<text text-anchor="start" x="226.5" y="-192.3" font-family="Roboto" font-size="14.00" fill="#000000">name</text>
+<polygon fill="#ffffff" stroke="transparent" points="221.5,-158.5 221.5,-183.5 293.5,-183.5 293.5,-158.5 221.5,-158.5"></polygon>
+<text text-anchor="start" x="226.5" y="-167.3" font-family="Roboto" font-size="14.00" fill="#000000">band</text>
+<polygon fill="#ffffff" stroke="transparent" points="221.5,-133.5 221.5,-158.5 293.5,-158.5 293.5,-133.5 221.5,-133.5"></polygon>
+<text text-anchor="start" x="226.5" y="-142.3" font-family="Roboto" font-size="14.00" fill="#000000">role</text>
+<polygon fill="none" stroke="#000000" points="220.5,-133 220.5,-260 294.5,-260 294.5,-133 220.5,-133"></polygon>
+</g>
+<!-- Play -->
+<g id="node5" class="node">
+<title>Play</title>
+<polygon fill="#ae7d4e" stroke="transparent" points="9,-169.5 9,-194.5 159,-194.5 159,-169.5 9,-169.5"></polygon>
+<text text-anchor="start" x="69" y="-178.3" font-family="Roboto" font-size="14.00" fill="#ffffff">Play</text>
+<polygon fill="#ffffff" stroke="transparent" points="9,-144.5 9,-169.5 159,-169.5 159,-144.5 9,-144.5"></polygon>
+<text text-anchor="start" x="14" y="-154.3" font-family="Roboto" text-decoration="underline" font-size="14.00" fill="#000000">#Musician_id</text>
+<polygon fill="#ffffff" stroke="transparent" points="9,-119.5 9,-144.5 159,-144.5 159,-119.5 9,-119.5"></polygon>
+<text text-anchor="start" x="14" y="-129.3" font-family="Roboto" text-decoration="underline" font-size="14.00" fill="#000000">#Instrument_name</text>
+<polygon fill="#ffffff" stroke="transparent" points="9,-94.5 9,-119.5 159,-119.5 159,-94.5 9,-94.5"></polygon>
+<text text-anchor="start" x="14" y="-103.3" font-family="Roboto" font-size="14.00" fill="#000000">event</text>
+<polygon fill="none" stroke="#000000" points="8,-93.5 8,-195.5 160,-195.5 160,-93.5 8,-93.5"></polygon>
+</g>
+<!-- Play&#45;&#45;Instrument -->
+<g id="edge4" class="edge">
+<title>Play:Instrument_name--Instrument:name</title>
+<path fill="none" stroke="#000000" d="M167.0953,-130.2787C193.4304,-121.4307 179.2043,-67.5 213.5,-67.5"></path>
+<ellipse fill="#000000" stroke="#000000" cx="162.9552" cy="-130.9032" rx="4" ry="4"></ellipse>
+</g>
+<!-- Play&#45;&#45;Musician -->
+<g id="edge3" class="edge">
+<title>Play:Musician_id--Musician:id</title>
+<path fill="none" stroke="#000000" d="M166.9606,-158.5053C196.5449,-166.6475 184.6929,-221.5 221.5,-221.5"></path>
+<ellipse fill="#000000" stroke="#000000" cx="162.9685" cy="-158.0012" rx="4" ry="4"></ellipse>
+</g>
+</g>
+</svg>
index 2919c56..d6cee80 100644 (file)
--- a/parser.js
+++ b/parser.js
@@ -187,8 +187,13 @@ class ErDiags
                                        name: inh.parent + "_id",
                                        type: this.tables[inh.parent][idx].type,
                                        isKey: true,
+<<<<<<< HEAD
+                                       qualifiers: (this.tables[inh.parent][idx].qualifiers || "") + " foreign key references " + inh.parent,
+                                       ref: inh.parent,
+=======
                                        qualifiers: this.tables[inh.parent][idx].qualifiers || "",
                                        ref: inh.parent + "(" + this.tables[inh.parent][idx].name + ")",
+>>>>>>> 40b4a9d230d105a61e22bef0a63a6e8d515524e9
                                });
                        });
                });
diff --git a/tata b/tata
new file mode 100644 (file)
index 0000000..105a26e
--- /dev/null
+++ b/tata
@@ -0,0 +1,32 @@
+graph {
+node [shape=plaintext];
+"Instrument" [label=<<table BORDER="1" ALIGN="LEFT" CELLPADDING="5" CELLSPACING="0">
+<tr><td BGCOLOR="#ae7d4e" BORDER="0"><font COLOR="#FFFFFF">Instrument</font></td></tr>
+<tr><td port="name" port="__key" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" ><u>name</u></font></td></tr>
+<tr><td port="family" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >family</font></td></tr>
+</table>>];
+"Piano" [label=<<table BORDER="1" ALIGN="LEFT" CELLPADDING="5" CELLSPACING="0">
+<tr><td BGCOLOR="#ae7d4e" BORDER="0"><font COLOR="#FFFFFF">Piano</font></td></tr>
+<tr><td port="type" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >type</font></td></tr>
+</table>>];
+"Guitar" [label=<<table BORDER="1" ALIGN="LEFT" CELLPADDING="5" CELLSPACING="0">
+<tr><td BGCOLOR="#ae7d4e" BORDER="0"><font COLOR="#FFFFFF">Guitar</font></td></tr>
+<tr><td port="type" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >type</font></td></tr>
+</table>>];
+"Play" [label=<<table BORDER="1" ALIGN="LEFT" CELLPADDING="5" CELLSPACING="0">
+<tr><td BGCOLOR="#ae7d4e" BORDER="0"><font COLOR="#FFFFFF">Play</font></td></tr>
+<tr><td port="Musician_id" port="__key" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" ><u>#Musician_id</u></font></td></tr>
+<tr><td port="Instrument_name" port="__key" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" ><u>#Instrument_name</u></font></td></tr>
+<tr><td port="event" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >event</font></td></tr>
+</table>>];
+"Musician" [label=<<table BORDER="1" ALIGN="LEFT" CELLPADDING="5" CELLSPACING="0">
+<tr><td BGCOLOR="#ae7d4e" BORDER="0"><font COLOR="#FFFFFF">Musician</font></td></tr>
+<tr><td port="id" port="__key" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" ><u>id</u></font></td></tr>
+<tr><td port="name" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >name</font></td></tr>
+<tr><td port="band" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >band</font></td></tr>
+<tr><td port="role" BGCOLOR="#FFFFFF" BORDER="0" ALIGN="LEFT"><font COLOR="#000000" >role</font></td></tr>
+</table>>];
+"Play":"Musician_id" -- "Musician":__key
+"Instrument":__key -- ""Play":"Instrument_name"
+
+}