generate svg of DBICTest::Schema in author mode people/felliott/test-schema-graphviz
Fitz Elliott [Wed, 9 Jul 2014 21:22:46 +0000 (17:22 -0400)]
 * Use SQL::Translator and GraphViz to produce an svg of the DBIC test
   schema layout.  The new file is examples/DBICTest/db-diagram.svg
   and will be generated when the Makefile.PL is run in author mode.

 * Add GraphViz to DBIC::Optional::Dependencies's dist_dir group

examples/DBICTest/db-diagram.svg [new file with mode: 0644]
lib/DBIx/Class/Optional/Dependencies.pm
maint/Makefile.PL.inc/56_autogen_schema_files.pl
maint/gen_dbictest_schema_diagram [new file with mode: 0644]

diff --git a/examples/DBICTest/db-diagram.svg b/examples/DBICTest/db-diagram.svg
new file mode 100644 (file)
index 0000000..6f6f307
--- /dev/null
@@ -0,0 +1,514 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<!-- Generated by graphviz version 2.38.0 (20140413.2041)
+ -->
+<!-- Title: test Pages: 1 -->
+<svg width="612pt" height="502pt"
+ viewBox="0.00 0.00 612.00 502.43" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g id="graph0" class="graph" transform="scale(0.475335 0.475335) rotate(0) translate(446.347 559.5)">
+<title>test</title>
+<polygon fill="white" stroke="none" points="-446.347,497.5 -446.347,-559.5 841.166,-559.5 841.166,497.5 -446.347,497.5"/>
+<!-- node1 -->
+<g id="node1" class="node"><title>node1</title>
+<polygon fill="white" stroke="black" points="96.0591,-3.8406 96.0591,-89.8406 262.874,-89.8406 262.874,-3.8406 96.0591,-3.8406"/>
+<text text-anchor="middle" x="179.466" y="-74.6406" font-family="Times,serif" font-size="14.00">artist</text>
+<polyline fill="none" stroke="black" points="96.0591,-67.8406 262.874,-67.8406 "/>
+<text text-anchor="start" x="104.059" y="-52.6406" font-family="Times,serif" font-size="14.00">&#45; artistid integer [PA]</text>
+<text text-anchor="start" x="104.059" y="-38.6406" font-family="Times,serif" font-size="14.00">&#45; name varchar(100) [U,N]</text>
+<text text-anchor="start" x="104.059" y="-24.6406" font-family="Times,serif" font-size="14.00">&#45; rank integer [U]</text>
+<text text-anchor="start" x="104.059" y="-10.6406" font-family="Times,serif" font-size="14.00">&#45; charfield char(10) [U,N]</text>
+</g>
+<!-- node21 -->
+<g id="node21" class="node"><title>node21</title>
+<polygon fill="white" stroke="black" points="280.484,-49.5692 280.484,-107.569 421.664,-107.569 421.664,-49.5692 280.484,-49.5692"/>
+<text text-anchor="middle" x="351.074" y="-92.3692" font-family="Times,serif" font-size="14.00">artist_undirected_map</text>
+<polyline fill="none" stroke="black" points="280.484,-85.5692 421.664,-85.5692 "/>
+<text text-anchor="start" x="288.484" y="-70.3692" font-family="Times,serif" font-size="14.00">&#45; id1 integer [PK]</text>
+<text text-anchor="start" x="288.484" y="-56.3692" font-family="Times,serif" font-size="14.00">&#45; id2 integer [PK]</text>
+</g>
+<!-- node1&#45;&gt;node21 -->
+<g id="edge1" class="edge"><title>node1&#45;&gt;node21</title>
+<path fill="none" stroke="black" d="M263.008,-62.2867C265.453,-62.7388 267.901,-63.1914 270.343,-63.6429"/>
+<polygon fill="black" stroke="black" points="269.862,-67.1133 280.332,-65.4898 271.135,-60.2299 269.862,-67.1133"/>
+</g>
+<!-- node25 -->
+<g id="node25" class="node"><title>node25</title>
+<polygon fill="white" stroke="black" points="256.077,-229.608 256.077,-287.608 381.322,-287.608 381.322,-229.608 256.077,-229.608"/>
+<text text-anchor="middle" x="318.7" y="-272.408" font-family="Times,serif" font-size="14.00">forceforeign</text>
+<polyline fill="none" stroke="black" points="256.077,-265.608 381.322,-265.608 "/>
+<text text-anchor="start" x="264.077" y="-250.408" font-family="Times,serif" font-size="14.00">&#45; artist integer [PK]</text>
+<text text-anchor="start" x="264.077" y="-236.408" font-family="Times,serif" font-size="14.00">&#45; cd integer</text>
+</g>
+<!-- node1&#45;&gt;node25 -->
+<g id="edge4" class="edge"><title>node1&#45;&gt;node25</title>
+<path fill="none" stroke="black" d="M207.81,-89.9501C233.132,-128.463 269.856,-184.318 294,-221.041"/>
+<polygon fill="black" stroke="black" points="291.134,-223.052 299.552,-229.485 296.983,-219.207 291.134,-223.052"/>
+</g>
+<!-- node28 -->
+<g id="node28" class="node"><title>node28</title>
+<polygon fill="white" stroke="black" points="-81.633,155.99 -81.633,41.9896 97.6502,41.9896 97.6502,155.99 -81.633,155.99"/>
+<text text-anchor="middle" x="8.00863" y="57.1896" font-family="Times,serif" font-size="14.00">cd</text>
+<polyline fill="none" stroke="black" points="-81.633,63.9896 97.6502,63.9896 "/>
+<text text-anchor="start" x="-73.633" y="79.1896" font-family="Times,serif" font-size="14.00">&#45; cdid integer [PA]</text>
+<text text-anchor="start" x="-73.633" y="93.1896" font-family="Times,serif" font-size="14.00">&#45; artist integer [U]</text>
+<text text-anchor="start" x="-73.633" y="107.19" font-family="Times,serif" font-size="14.00">&#45; title varchar(100) [U]</text>
+<text text-anchor="start" x="-73.633" y="121.19" font-family="Times,serif" font-size="14.00">&#45; year varchar(100)</text>
+<text text-anchor="start" x="-73.633" y="135.19" font-family="Times,serif" font-size="14.00">&#45; genreid integer [N]</text>
+<text text-anchor="start" x="-73.633" y="149.19" font-family="Times,serif" font-size="14.00">&#45; single_track integer [FK,N]</text>
+</g>
+<!-- node1&#45;&gt;node28 -->
+<g id="edge3" class="edge"><title>node1&#45;&gt;node28</title>
+<path fill="none" stroke="black" d="M128.488,-3.48158C114.281,8.60124 98.5427,21.9875 83.2554,34.9898"/>
+<polygon fill="black" stroke="black" points="85.1978,37.9324 75.3128,41.7452 80.6626,32.6003 85.1978,37.9324"/>
+</g>
+<!-- node37 -->
+<g id="node37" class="node"><title>node37</title>
+<polygon fill="white" stroke="black" points="-51.2818,-58.7241 -51.2818,-116.724 73.9633,-116.724 73.9633,-58.7241 -51.2818,-58.7241"/>
+<text text-anchor="middle" x="11.3407" y="-101.524" font-family="Times,serif" font-size="14.00">twokeys</text>
+<polyline fill="none" stroke="black" points="-51.2818,-94.7241 73.9633,-94.7241 "/>
+<text text-anchor="start" x="-43.2818" y="-79.5241" font-family="Times,serif" font-size="14.00">&#45; artist integer [PK]</text>
+<text text-anchor="start" x="-43.2818" y="-65.5241" font-family="Times,serif" font-size="14.00">&#45; cd integer [PK]</text>
+</g>
+<!-- node1&#45;&gt;node37 -->
+<g id="edge5" class="edge"><title>node1&#45;&gt;node37</title>
+<path fill="none" stroke="black" d="M95.8961,-67.1626C92.0433,-68.0994 88.1892,-69.0367 84.366,-69.9663"/>
+<polygon fill="black" stroke="black" points="83.2304,-66.6404 74.3406,-72.4043 84.8844,-73.4422 83.2304,-66.6404"/>
+</g>
+<!-- node38 -->
+<g id="node38" class="node"><title>node38</title>
+<polygon fill="white" stroke="black" points="246.744,141.973 246.744,83.9728 447.034,83.9728 447.034,141.973 246.744,141.973"/>
+<text text-anchor="middle" x="346.889" y="99.1728" font-family="Times,serif" font-size="14.00">artwork_to_artist</text>
+<polyline fill="none" stroke="black" points="246.744,105.973 447.034,105.973 "/>
+<text text-anchor="start" x="254.744" y="121.173" font-family="Times,serif" font-size="14.00">&#45; artwork_cd_id integer [PK,FK]</text>
+<text text-anchor="start" x="254.744" y="135.173" font-family="Times,serif" font-size="14.00">&#45; artist_id integer [PK,FK]</text>
+</g>
+<!-- node1&#45;&gt;node38 -->
+<g id="edge2" class="edge"><title>node1&#45;&gt;node38</title>
+<path fill="none" stroke="black" d="M224.773,-3.59281C251.102,21.5394 283.902,52.8486 308.877,76.6882"/>
+<polygon fill="black" stroke="black" points="311.544,74.3953 316.361,83.8319 306.711,79.4588 311.544,74.3953"/>
+</g>
+<!-- node2 -->
+<g id="node2" class="node"><title>node2</title>
+<polygon fill="white" stroke="black" points="286.102,-417 286.102,-517 419.898,-517 419.898,-417 286.102,-417"/>
+<text text-anchor="middle" x="353" y="-501.8" font-family="Times,serif" font-size="14.00">bindtype_test</text>
+<polyline fill="none" stroke="black" points="286.102,-495 419.898,-495 "/>
+<text text-anchor="start" x="294.102" y="-479.8" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="294.102" y="-465.8" font-family="Times,serif" font-size="14.00">&#45; bytea bytea [N]</text>
+<text text-anchor="start" x="294.102" y="-451.8" font-family="Times,serif" font-size="14.00">&#45; blob blob [N]</text>
+<text text-anchor="start" x="294.102" y="-437.8" font-family="Times,serif" font-size="14.00">&#45; clob clob [N]</text>
+<text text-anchor="start" x="294.102" y="-423.8" font-family="Times,serif" font-size="14.00">&#45; a_memo memo [N]</text>
+</g>
+<!-- node3 -->
+<g id="node3" class="node"><title>node3</title>
+<polygon fill="white" stroke="black" points="337.941,226.635 337.941,168.635 499.998,168.635 499.998,226.635 337.941,226.635"/>
+<text text-anchor="middle" x="418.97" y="183.835" font-family="Times,serif" font-size="14.00">collection</text>
+<polyline fill="none" stroke="black" points="337.941,190.635 499.998,190.635 "/>
+<text text-anchor="start" x="345.941" y="205.835" font-family="Times,serif" font-size="14.00">&#45; collectionid integer [PA]</text>
+<text text-anchor="start" x="345.941" y="219.835" font-family="Times,serif" font-size="14.00">&#45; name varchar(100)</text>
+</g>
+<!-- node29 -->
+<g id="node29" class="node"><title>node29</title>
+<polygon fill="white" stroke="black" points="516.954,226.635 516.954,168.635 669.407,168.635 669.407,226.635 516.954,226.635"/>
+<text text-anchor="middle" x="593.181" y="183.835" font-family="Times,serif" font-size="14.00">collection_object</text>
+<polyline fill="none" stroke="black" points="516.954,190.635 669.407,190.635 "/>
+<text text-anchor="start" x="524.954" y="205.835" font-family="Times,serif" font-size="14.00">&#45; collection integer [PK]</text>
+<text text-anchor="start" x="524.954" y="219.835" font-family="Times,serif" font-size="14.00">&#45; object integer [PK]</text>
+</g>
+<!-- node3&#45;&gt;node29 -->
+<g id="edge14" class="edge"><title>node3&#45;&gt;node29</title>
+<path fill="none" stroke="black" d="M500.21,197.635C502.358,197.635 504.511,197.635 506.664,197.635"/>
+<polygon fill="black" stroke="black" points="506.715,194.135 516.715,197.635 506.715,201.135 506.715,194.135"/>
+</g>
+<!-- node4 -->
+<g id="node4" class="node"><title>node4</title>
+<polygon fill="white" stroke="black" points="285.701,-321.703 285.701,-379.703 455.23,-379.703 455.23,-321.703 285.701,-321.703"/>
+<text text-anchor="middle" x="370.466" y="-364.503" font-family="Times,serif" font-size="14.00">encoded</text>
+<polyline fill="none" stroke="black" points="285.701,-357.703 455.23,-357.703 "/>
+<text text-anchor="start" x="293.701" y="-342.503" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="293.701" y="-328.503" font-family="Times,serif" font-size="14.00">&#45; encoded varchar(100) [N]</text>
+</g>
+<!-- node24 -->
+<g id="node24" class="node"><title>node24</title>
+<polygon fill="white" stroke="black" points="467.297,-286.658 467.297,-414.658 635.574,-414.658 635.574,-286.658 467.297,-286.658"/>
+<text text-anchor="middle" x="551.435" y="-399.458" font-family="Times,serif" font-size="14.00">employee</text>
+<polyline fill="none" stroke="black" points="467.297,-392.658 635.574,-392.658 "/>
+<text text-anchor="start" x="475.297" y="-377.458" font-family="Times,serif" font-size="14.00">&#45; employee_id integer [PA]</text>
+<text text-anchor="start" x="475.297" y="-363.458" font-family="Times,serif" font-size="14.00">&#45; position integer</text>
+<text text-anchor="start" x="475.297" y="-349.458" font-family="Times,serif" font-size="14.00">&#45; group_id integer [N]</text>
+<text text-anchor="start" x="475.297" y="-335.458" font-family="Times,serif" font-size="14.00">&#45; group_id_2 integer [N]</text>
+<text text-anchor="start" x="475.297" y="-321.458" font-family="Times,serif" font-size="14.00">&#45; group_id_3 integer [N]</text>
+<text text-anchor="start" x="475.297" y="-307.458" font-family="Times,serif" font-size="14.00">&#45; name varchar(100) [N]</text>
+<text text-anchor="start" x="475.297" y="-293.458" font-family="Times,serif" font-size="14.00">&#45; encoded integer [N]</text>
+</g>
+<!-- node4&#45;&gt;node24 -->
+<g id="edge15" class="edge"><title>node4&#45;&gt;node24</title>
+<path fill="none" stroke="black" d="M455.387,-350.682C456.004,-350.682 456.621,-350.682 457.239,-350.681"/>
+<polygon fill="none" stroke="black" points="457.246,-354.181 467.245,-350.679 457.245,-347.181 457.246,-354.181"/>
+</g>
+<!-- node5 -->
+<g id="node5" class="node"><title>node5</title>
+<polygon fill="white" stroke="black" points="-337.526,-365 -337.526,-493 -124.474,-493 -124.474,-365 -337.526,-365"/>
+<text text-anchor="middle" x="-231" y="-477.8" font-family="Times,serif" font-size="14.00">event</text>
+<polyline fill="none" stroke="black" points="-337.526,-471 -124.474,-471 "/>
+<text text-anchor="start" x="-329.526" y="-455.8" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="-329.526" y="-441.8" font-family="Times,serif" font-size="14.00">&#45; starts_at date</text>
+<text text-anchor="start" x="-329.526" y="-427.8" font-family="Times,serif" font-size="14.00">&#45; created_on timestamp</text>
+<text text-anchor="start" x="-329.526" y="-413.8" font-family="Times,serif" font-size="14.00">&#45; varchar_date varchar(20) [N]</text>
+<text text-anchor="start" x="-329.526" y="-399.8" font-family="Times,serif" font-size="14.00">&#45; varchar_datetime varchar(20) [N]</text>
+<text text-anchor="start" x="-329.526" y="-385.8" font-family="Times,serif" font-size="14.00">&#45; skip_inflation datetime [N]</text>
+<text text-anchor="start" x="-329.526" y="-371.8" font-family="Times,serif" font-size="14.00">&#45; ts_without_tz datetime [N]</text>
+</g>
+<!-- node6 -->
+<g id="node6" class="node"><title>node6</title>
+<polygon fill="white" stroke="black" points="-189.172,-202.426 -189.172,-316.426 -43.7059,-316.426 -43.7059,-202.426 -189.172,-202.426"/>
+<text text-anchor="middle" x="-116.439" y="-301.226" font-family="Times,serif" font-size="14.00">fourkeys</text>
+<polyline fill="none" stroke="black" points="-189.172,-294.426 -43.7059,-294.426 "/>
+<text text-anchor="start" x="-181.172" y="-279.226" font-family="Times,serif" font-size="14.00">&#45; foo integer [PK]</text>
+<text text-anchor="start" x="-181.172" y="-265.226" font-family="Times,serif" font-size="14.00">&#45; bar integer [PK]</text>
+<text text-anchor="start" x="-181.172" y="-251.226" font-family="Times,serif" font-size="14.00">&#45; hello integer [PK]</text>
+<text text-anchor="start" x="-181.172" y="-237.226" font-family="Times,serif" font-size="14.00">&#45; goodbye integer [PK]</text>
+<text text-anchor="start" x="-181.172" y="-223.226" font-family="Times,serif" font-size="14.00">&#45; sensors character</text>
+<text text-anchor="start" x="-181.172" y="-209.226" font-family="Times,serif" font-size="14.00">&#45; read_count int [N]</text>
+</g>
+<!-- node39 -->
+<g id="node39" class="node"><title>node39</title>
+<polygon fill="white" stroke="black" points="16.3834,-184.766 16.3834,-326.766 189.822,-326.766 189.822,-184.766 16.3834,-184.766"/>
+<text text-anchor="middle" x="103.103" y="-311.566" font-family="Times,serif" font-size="14.00">fourkeys_to_twokeys</text>
+<polyline fill="none" stroke="black" points="16.3834,-304.766 189.822,-304.766 "/>
+<text text-anchor="start" x="24.3834" y="-289.566" font-family="Times,serif" font-size="14.00">&#45; f_foo integer [PK]</text>
+<text text-anchor="start" x="24.3834" y="-275.566" font-family="Times,serif" font-size="14.00">&#45; f_bar integer [PK]</text>
+<text text-anchor="start" x="24.3834" y="-261.566" font-family="Times,serif" font-size="14.00">&#45; f_hello integer [PK]</text>
+<text text-anchor="start" x="24.3834" y="-247.566" font-family="Times,serif" font-size="14.00">&#45; f_goodbye integer [PK]</text>
+<text text-anchor="start" x="24.3834" y="-233.566" font-family="Times,serif" font-size="14.00">&#45; t_artist integer [PK]</text>
+<text text-anchor="start" x="24.3834" y="-219.566" font-family="Times,serif" font-size="14.00">&#45; t_cd integer [PK]</text>
+<text text-anchor="start" x="24.3834" y="-205.566" font-family="Times,serif" font-size="14.00">&#45; autopilot character</text>
+<text text-anchor="start" x="24.3834" y="-191.566" font-family="Times,serif" font-size="14.00">&#45; pilot_sequence integer [N]</text>
+</g>
+<!-- node6&#45;&gt;node39 -->
+<g id="edge16" class="edge"><title>node6&#45;&gt;node39</title>
+<path fill="none" stroke="black" d="M-43.6396,-258.212C-27.8248,-257.948 -10.8509,-257.665 5.74011,-257.389"/>
+<polygon fill="black" stroke="black" points="6.06683,-260.884 16.0071,-257.218 5.95007,-253.885 6.06683,-260.884"/>
+</g>
+<!-- node7 -->
+<g id="node7" class="node"><title>node7</title>
+<polygon fill="white" stroke="black" points="-104.364,329.556 -104.364,271.556 48.8399,271.556 48.8399,329.556 -104.364,329.556"/>
+<text text-anchor="middle" x="-27.7621" y="286.756" font-family="Times,serif" font-size="14.00">genre</text>
+<polyline fill="none" stroke="black" points="-104.364,293.556 48.8399,293.556 "/>
+<text text-anchor="start" x="-96.3642" y="308.756" font-family="Times,serif" font-size="14.00">&#45; genreid integer [PA]</text>
+<text text-anchor="start" x="-96.3642" y="322.756" font-family="Times,serif" font-size="14.00">&#45; name varchar(100) [U]</text>
+</g>
+<!-- node7&#45;&gt;node28 -->
+<g id="edge17" class="edge"><title>node7&#45;&gt;node28</title>
+<path fill="none" stroke="black" d="M-22.5607,271.247C-17.69,243.801 -10.2337,201.784 -3.90448,166.12"/>
+<polygon fill="none" stroke="black" points="-7.34588,165.481 -2.15231,156.246 -0.453564,166.704 -7.34588,165.481"/>
+</g>
+<!-- node8 -->
+<g id="node8" class="node"><title>node8</title>
+<polygon fill="white" stroke="black" points="415.681,-156.513 415.681,-228.513 560.34,-228.513 560.34,-156.513 415.681,-156.513"/>
+<text text-anchor="middle" x="488.011" y="-213.313" font-family="Times,serif" font-size="14.00">link</text>
+<polyline fill="none" stroke="black" points="415.681,-206.513 560.34,-206.513 "/>
+<text text-anchor="start" x="423.681" y="-191.313" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="423.681" y="-177.313" font-family="Times,serif" font-size="14.00">&#45; url varchar(100) [N]</text>
+<text text-anchor="start" x="423.681" y="-163.313" font-family="Times,serif" font-size="14.00">&#45; title varchar(100) [N]</text>
+</g>
+<!-- node22 -->
+<g id="node22" class="node"><title>node22</title>
+<polygon fill="white" stroke="black" points="569.62,-163.486 569.62,-221.486 680.866,-221.486 680.866,-163.486 569.62,-163.486"/>
+<text text-anchor="middle" x="625.243" y="-206.286" font-family="Times,serif" font-size="14.00">bookmark</text>
+<polyline fill="none" stroke="black" points="569.62,-199.486 680.866,-199.486 "/>
+<text text-anchor="start" x="577.62" y="-184.286" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="577.62" y="-170.286" font-family="Times,serif" font-size="14.00">&#45; link integer [N]</text>
+</g>
+<!-- node8&#45;&gt;node22 -->
+<g id="edge18" class="edge"><title>node8&#45;&gt;node22</title>
+<path fill="none" stroke="black" d="M560.645,-192.499C560.738,-192.499 560.83,-192.499 560.922,-192.499"/>
+<polygon fill="none" stroke="black" points="559.466,-195.999 569.465,-192.497 559.465,-188.999 559.466,-195.999"/>
+</g>
+<!-- node9 -->
+<g id="node9" class="node"><title>node9</title>
+<polygon fill="white" stroke="black" points="-442.347,181 -442.347,123 -311.653,123 -311.653,181 -442.347,181"/>
+<text text-anchor="middle" x="-377" y="138.2" font-family="Times,serif" font-size="14.00">money_test</text>
+<polyline fill="none" stroke="black" points="-442.347,145 -311.653,145 "/>
+<text text-anchor="start" x="-434.347" y="160.2" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="-434.347" y="174.2" font-family="Times,serif" font-size="14.00">&#45; amount money [N]</text>
+</g>
+<!-- node10 -->
+<g id="node10" class="node"><title>node10</title>
+<polygon fill="white" stroke="black" points="77.936,493 77.936,421 186.064,421 186.064,493 77.936,493"/>
+<text text-anchor="middle" x="132" y="436.2" font-family="Times,serif" font-size="14.00">noprimarykey</text>
+<polyline fill="none" stroke="black" points="77.936,443 186.064,443 "/>
+<text text-anchor="start" x="85.936" y="458.2" font-family="Times,serif" font-size="14.00">&#45; foo integer [U]</text>
+<text text-anchor="start" x="85.936" y="472.2" font-family="Times,serif" font-size="14.00">&#45; bar integer [U]</text>
+<text text-anchor="start" x="85.936" y="486.2" font-family="Times,serif" font-size="14.00">&#45; baz integer</text>
+</g>
+<!-- node11 -->
+<g id="node11" class="node"><title>node11</title>
+<polygon fill="white" stroke="black" points="-78.4282,441 -78.4282,369 28.4282,369 28.4282,441 -78.4282,441"/>
+<text text-anchor="middle" x="-25" y="384.2" font-family="Times,serif" font-size="14.00">onekey</text>
+<polyline fill="none" stroke="black" points="-78.4282,391 28.4282,391 "/>
+<text text-anchor="start" x="-70.4282" y="406.2" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="-70.4282" y="420.2" font-family="Times,serif" font-size="14.00">&#45; artist integer</text>
+<text text-anchor="start" x="-70.4282" y="434.2" font-family="Times,serif" font-size="14.00">&#45; cd integer</text>
+</g>
+<!-- node12 -->
+<g id="node12" class="node"><title>node12</title>
+<polygon fill="white" stroke="black" points="-77.6912,-385.687 -77.6912,-443.687 75.5129,-443.687 75.5129,-385.687 -77.6912,-385.687"/>
+<text text-anchor="middle" x="-1.08916" y="-428.487" font-family="Times,serif" font-size="14.00">owners</text>
+<polyline fill="none" stroke="black" points="-77.6912,-421.687 75.5129,-421.687 "/>
+<text text-anchor="start" x="-69.6912" y="-406.487" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="-69.6912" y="-392.487" font-family="Times,serif" font-size="14.00">&#45; name varchar(100) [U]</text>
+</g>
+<!-- node23 -->
+<g id="node23" class="node"><title>node23</title>
+<polygon fill="white" stroke="black" points="92.91,-364.674 92.91,-464.674 237.569,-464.674 237.569,-364.674 92.91,-364.674"/>
+<text text-anchor="middle" x="165.24" y="-449.474" font-family="Times,serif" font-size="14.00">books</text>
+<polyline fill="none" stroke="black" points="92.91,-442.674 237.569,-442.674 "/>
+<text text-anchor="start" x="100.91" y="-427.474" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="100.91" y="-413.474" font-family="Times,serif" font-size="14.00">&#45; source varchar(100)</text>
+<text text-anchor="start" x="100.91" y="-399.474" font-family="Times,serif" font-size="14.00">&#45; owner integer</text>
+<text text-anchor="start" x="100.91" y="-385.474" font-family="Times,serif" font-size="14.00">&#45; title varchar(100) [U]</text>
+<text text-anchor="start" x="100.91" y="-371.474" font-family="Times,serif" font-size="14.00">&#45; price integer [N]</text>
+</g>
+<!-- node12&#45;&gt;node23 -->
+<g id="edge20" class="edge"><title>node12&#45;&gt;node23</title>
+<path fill="none" stroke="black" d="M75.7459,-414.681C78.0627,-414.681 80.3862,-414.681 82.7089,-414.68"/>
+<polygon fill="black" stroke="black" points="82.8669,-418.18 92.8666,-414.68 82.8663,-411.18 82.8669,-418.18"/>
+</g>
+<!-- node13 -->
+<g id="node13" class="node"><title>node13</title>
+<polygon fill="white" stroke="black" points="-411.162,-200.639 -411.162,-258.639 -254.554,-258.639 -254.554,-200.639 -411.162,-200.639"/>
+<text text-anchor="middle" x="-332.858" y="-243.439" font-family="Times,serif" font-size="14.00">producer</text>
+<polyline fill="none" stroke="black" points="-411.162,-236.639 -254.554,-236.639 "/>
+<text text-anchor="start" x="-403.162" y="-221.439" font-family="Times,serif" font-size="14.00">&#45; producerid integer [PA]</text>
+<text text-anchor="start" x="-403.162" y="-207.439" font-family="Times,serif" font-size="14.00">&#45; name varchar(100) [U]</text>
+</g>
+<!-- node35 -->
+<g id="node35" class="node"><title>node35</title>
+<polygon fill="white" stroke="black" points="-239.496,-28.7578 -239.496,-100.758 -92.4925,-100.758 -92.4925,-28.7578 -239.496,-28.7578"/>
+<text text-anchor="middle" x="-165.994" y="-85.5578" font-family="Times,serif" font-size="14.00">cd_to_producer</text>
+<polyline fill="none" stroke="black" points="-239.496,-78.7578 -92.4925,-78.7578 "/>
+<text text-anchor="start" x="-231.496" y="-63.5578" font-family="Times,serif" font-size="14.00">&#45; cd integer [PK]</text>
+<text text-anchor="start" x="-231.496" y="-49.5578" font-family="Times,serif" font-size="14.00">&#45; producer integer [PK]</text>
+<text text-anchor="start" x="-231.496" y="-35.5578" font-family="Times,serif" font-size="14.00">&#45; attribute integer [N]</text>
+</g>
+<!-- node13&#45;&gt;node35 -->
+<g id="edge21" class="edge"><title>node13&#45;&gt;node35</title>
+<path fill="none" stroke="black" d="M-303.41,-200.541C-277.535,-174.973 -239.519,-137.409 -210.028,-108.268"/>
+<polygon fill="black" stroke="black" points="-207.379,-110.572 -202.726,-101.053 -212.3,-105.592 -207.379,-110.572"/>
+</g>
+<!-- node14 -->
+<g id="node14" class="node"><title>node14</title>
+<polygon fill="white" stroke="black" points="259.803,440.999 259.803,382.999 390.073,382.999 390.073,440.999 259.803,440.999"/>
+<text text-anchor="middle" x="324.938" y="398.199" font-family="Times,serif" font-size="14.00">self_ref</text>
+<polyline fill="none" stroke="black" points="259.803,404.999 390.073,404.999 "/>
+<text text-anchor="start" x="267.803" y="420.199" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="267.803" y="434.199" font-family="Times,serif" font-size="14.00">&#45; name varchar(100)</text>
+</g>
+<!-- node26 -->
+<g id="node26" class="node"><title>node26</title>
+<polygon fill="white" stroke="black" points="411.748,441.001 411.748,383.001 551.752,383.001 551.752,441.001 411.748,441.001"/>
+<text text-anchor="middle" x="481.75" y="398.201" font-family="Times,serif" font-size="14.00">self_ref_alias</text>
+<polyline fill="none" stroke="black" points="411.748,405.001 551.752,405.001 "/>
+<text text-anchor="start" x="419.748" y="420.201" font-family="Times,serif" font-size="14.00">&#45; self_ref integer [PK]</text>
+<text text-anchor="start" x="419.748" y="434.201" font-family="Times,serif" font-size="14.00">&#45; alias integer [PK]</text>
+</g>
+<!-- node14&#45;&gt;node26 -->
+<g id="edge22" class="edge"><title>node14&#45;&gt;node26</title>
+<path fill="none" stroke="black" d="M390.078,412C393.878,412 397.72,412 401.569,412"/>
+<polygon fill="black" stroke="black" points="401.743,408.5 411.743,412 401.743,415.5 401.743,408.5"/>
+</g>
+<!-- node15 -->
+<g id="node15" class="node"><title>node15</title>
+<polygon fill="white" stroke="black" points="468.398,-469 468.398,-555 621.602,-555 621.602,-469 468.398,-469"/>
+<text text-anchor="middle" x="545" y="-539.8" font-family="Times,serif" font-size="14.00">sequence_test</text>
+<polyline fill="none" stroke="black" points="468.398,-533 621.602,-533 "/>
+<text text-anchor="start" x="476.398" y="-517.8" font-family="Times,serif" font-size="14.00">&#45; pkid1 integer [PK]</text>
+<text text-anchor="start" x="476.398" y="-503.8" font-family="Times,serif" font-size="14.00">&#45; pkid2 integer [PK]</text>
+<text text-anchor="start" x="476.398" y="-489.8" font-family="Times,serif" font-size="14.00">&#45; nonpkid integer</text>
+<text text-anchor="start" x="476.398" y="-475.8" font-family="Times,serif" font-size="14.00">&#45; name varchar(100) [N]</text>
+</g>
+<!-- node16 -->
+<g id="node16" class="node"><title>node16</title>
+<polygon fill="white" stroke="black" points="467.572,337 467.572,279 574.428,279 574.428,337 467.572,337"/>
+<text text-anchor="middle" x="521" y="294.2" font-family="Times,serif" font-size="14.00">serialized</text>
+<polyline fill="none" stroke="black" points="467.572,301 574.428,301 "/>
+<text text-anchor="start" x="475.572" y="316.2" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="475.572" y="330.2" font-family="Times,serif" font-size="14.00">&#45; serialized text</text>
+</g>
+<!-- node17 -->
+<g id="node17" class="node"><title>node17</title>
+<polygon fill="white" stroke="black" points="-441.648,441 -441.648,397 -262.352,397 -262.352,441 -441.648,441"/>
+<text text-anchor="middle" x="-352" y="412.2" font-family="Times,serif" font-size="14.00">timestamp_primary_key_test</text>
+<polyline fill="none" stroke="black" points="-441.648,419 -262.352,419 "/>
+<text text-anchor="start" x="-433.648" y="434.2" font-family="Times,serif" font-size="14.00">&#45; id timestamp [PK]</text>
+</g>
+<!-- node18 -->
+<g id="node18" class="node"><title>node18</title>
+<polygon fill="white" stroke="black" points="-442.135,-79 -442.135,-151 -311.865,-151 -311.865,-79 -442.135,-79"/>
+<text text-anchor="middle" x="-377" y="-135.8" font-family="Times,serif" font-size="14.00">treelike</text>
+<polyline fill="none" stroke="black" points="-442.135,-129 -311.865,-129 "/>
+<text text-anchor="start" x="-434.135" y="-113.8" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="-434.135" y="-99.8" font-family="Times,serif" font-size="14.00">&#45; parent integer [N]</text>
+<text text-anchor="start" x="-434.135" y="-85.8" font-family="Times,serif" font-size="14.00">&#45; name varchar(100)</text>
+</g>
+<!-- node18&#45;&gt;node18 -->
+<g id="edge25" class="edge"><title>node18&#45;&gt;node18</title>
+<path fill="none" stroke="black" d="M-311.823,-121.245C-301.18,-120.351 -293.865,-118.27 -293.865,-115 -293.865,-112.905 -296.867,-111.298 -301.823,-110.179"/>
+<polygon fill="none" stroke="black" points="-301.429,-106.7 -311.823,-108.755 -302.416,-113.63 -301.429,-106.7"/>
+</g>
+<!-- node19 -->
+<g id="node19" class="node"><title>node19</title>
+<polygon fill="white" stroke="black" points="468.398,25 468.398,-75 621.602,-75 621.602,25 468.398,25"/>
+<text text-anchor="middle" x="545" y="-59.8" font-family="Times,serif" font-size="14.00">twokeytreelike</text>
+<polyline fill="none" stroke="black" points="468.398,-53 621.602,-53 "/>
+<text text-anchor="start" x="476.398" y="-37.8" font-family="Times,serif" font-size="14.00">&#45; id1 integer [PK]</text>
+<text text-anchor="start" x="476.398" y="-23.8" font-family="Times,serif" font-size="14.00">&#45; id2 integer [PK]</text>
+<text text-anchor="start" x="476.398" y="-9.8" font-family="Times,serif" font-size="14.00">&#45; parent1 integer</text>
+<text text-anchor="start" x="476.398" y="4.2" font-family="Times,serif" font-size="14.00">&#45; parent2 integer</text>
+<text text-anchor="start" x="476.398" y="18.2" font-family="Times,serif" font-size="14.00">&#45; name varchar(100) [U]</text>
+</g>
+<!-- node19&#45;&gt;node19 -->
+<g id="edge27" class="edge"><title>node19&#45;&gt;node19</title>
+<path fill="none" stroke="black" d="M621.836,-31.0233C632.485,-30.0312 639.602,-28.0234 639.602,-25 639.602,-23.0631 636.681,-21.5431 631.782,-20.4398"/>
+<polygon fill="black" stroke="black" points="632.239,-16.9695 621.836,-18.9767 631.22,-23.895 632.239,-16.9695"/>
+</g>
+<!-- node20 -->
+<g id="node20" class="node"><title>node20</title>
+<polygon fill="white" stroke="black" points="696.103,233.635 696.103,161.635 837.166,161.635 837.166,233.635 696.103,233.635"/>
+<text text-anchor="middle" x="766.634" y="176.835" font-family="Times,serif" font-size="14.00">typed_object</text>
+<polyline fill="none" stroke="black" points="696.103,183.635 837.166,183.635 "/>
+<text text-anchor="start" x="704.103" y="198.835" font-family="Times,serif" font-size="14.00">&#45; objectid integer [PA]</text>
+<text text-anchor="start" x="704.103" y="212.835" font-family="Times,serif" font-size="14.00">&#45; type varchar(100)</text>
+<text text-anchor="start" x="704.103" y="226.835" font-family="Times,serif" font-size="14.00">&#45; value varchar(100)</text>
+</g>
+<!-- node20&#45;&gt;node29 -->
+<g id="edge28" class="edge"><title>node20&#45;&gt;node29</title>
+<path fill="none" stroke="black" d="M696.084,197.635C690.769,197.635 685.369,197.635 679.97,197.635"/>
+<polygon fill="black" stroke="black" points="679.607,201.135 669.607,197.635 679.607,194.135 679.607,201.135"/>
+</g>
+<!-- node27 -->
+<g id="node27" class="node"><title>node27</title>
+<polygon fill="white" stroke="black" points="-442.087,76.5083 -442.087,-37.4917 -251.532,-37.4917 -251.532,76.5083 -442.087,76.5083"/>
+<text text-anchor="middle" x="-346.809" y="-22.2917" font-family="Times,serif" font-size="14.00">track</text>
+<polyline fill="none" stroke="black" points="-442.087,-15.4917 -251.532,-15.4917 "/>
+<text text-anchor="start" x="-434.087" y="-0.291719" font-family="Times,serif" font-size="14.00">&#45; trackid integer [PA]</text>
+<text text-anchor="start" x="-434.087" y="13.7083" font-family="Times,serif" font-size="14.00">&#45; cd integer [U]</text>
+<text text-anchor="start" x="-434.087" y="27.7083" font-family="Times,serif" font-size="14.00">&#45; position int [U]</text>
+<text text-anchor="start" x="-434.087" y="41.7083" font-family="Times,serif" font-size="14.00">&#45; title varchar(100) [U]</text>
+<text text-anchor="start" x="-434.087" y="55.7083" font-family="Times,serif" font-size="14.00">&#45; last_updated_on datetime [N]</text>
+<text text-anchor="start" x="-434.087" y="69.7083" font-family="Times,serif" font-size="14.00">&#45; last_updated_at datetime [N]</text>
+</g>
+<!-- node27&#45;&gt;node28 -->
+<g id="edge23" class="edge"><title>node27&#45;&gt;node28</title>
+<path fill="none" stroke="black" d="M-251.336,34.7048C-201.961,44.8387 -141.737,58.2879 -91.7554,70.3278"/>
+<polygon fill="none" stroke="black" points="-90.7962,66.9588 -81.9018,72.7156 -92.4448,73.7619 -90.7962,66.9588"/>
+</g>
+<!-- node30 -->
+<g id="node30" class="node"><title>node30</title>
+<polygon fill="white" stroke="black" points="-266.647,356.112 -266.647,298.112 -123.526,298.112 -123.526,356.112 -266.647,356.112"/>
+<text text-anchor="middle" x="-195.086" y="313.312" font-family="Times,serif" font-size="14.00">lyrics</text>
+<polyline fill="none" stroke="black" points="-266.647,320.112 -123.526,320.112 "/>
+<text text-anchor="start" x="-258.647" y="335.312" font-family="Times,serif" font-size="14.00">&#45; lyric_id integer [PA]</text>
+<text text-anchor="start" x="-258.647" y="349.312" font-family="Times,serif" font-size="14.00">&#45; track_id integer [FK]</text>
+</g>
+<!-- node27&#45;&gt;node30 -->
+<g id="edge24" class="edge"><title>node27&#45;&gt;node30</title>
+<path fill="none" stroke="black" d="M-318.627,76.6453C-288.149,138.437 -240.404,235.235 -214.086,288.593"/>
+<polygon fill="black" stroke="black" points="-210.87,287.2 -209.585,297.717 -217.148,290.297 -210.87,287.2"/>
+</g>
+<!-- node28&#45;&gt;node27 -->
+<g id="edge10" class="edge"><title>node28&#45;&gt;node27</title>
+<path fill="none" stroke="black" d="M-81.9088,84.9288C-130.422,75.0546 -190.576,61.6881 -241.296,49.5506"/>
+<polygon fill="black" stroke="black" points="-242.404,52.8838 -251.308,47.1408 -240.766,46.0781 -242.404,52.8838"/>
+</g>
+<!-- node31 -->
+<g id="node31" class="node"><title>node31</title>
+<polygon fill="white" stroke="black" points="107.534,175.486 107.534,131.486 235.89,131.486 235.89,175.486 107.534,175.486"/>
+<text text-anchor="middle" x="171.712" y="146.686" font-family="Times,serif" font-size="14.00">cd_artwork</text>
+<polyline fill="none" stroke="black" points="107.534,153.486 235.89,153.486 "/>
+<text text-anchor="start" x="115.534" y="168.686" font-family="Times,serif" font-size="14.00">&#45; cd_id integer [PK]</text>
+</g>
+<!-- node28&#45;&gt;node31 -->
+<g id="edge6" class="edge"><title>node28&#45;&gt;node31</title>
+<path fill="none" stroke="black" d="M98.0014,128.948C98.0989,128.98 98.1964,129.013 98.2939,129.045"/>
+<polygon fill="black" stroke="black" points="98.914,125.563 107.297,132.042 96.7029,132.204 98.914,125.563"/>
+</g>
+<!-- node32 -->
+<g id="node32" class="node"><title>node32</title>
+<polygon fill="white" stroke="black" points="-243.114,162.449 -243.114,104.449 -102.318,104.449 -102.318,162.449 -243.114,162.449"/>
+<text text-anchor="middle" x="-172.716" y="119.649" font-family="Times,serif" font-size="14.00">liner_notes</text>
+<polyline fill="none" stroke="black" points="-243.114,126.449 -102.318,126.449 "/>
+<text text-anchor="start" x="-235.114" y="141.649" font-family="Times,serif" font-size="14.00">&#45; liner_id integer [PK]</text>
+<text text-anchor="start" x="-235.114" y="155.649" font-family="Times,serif" font-size="14.00">&#45; notes varchar(100)</text>
+</g>
+<!-- node28&#45;&gt;node32 -->
+<g id="edge8" class="edge"><title>node28&#45;&gt;node32</title>
+<path fill="none" stroke="black" d="M-81.8242,116.119C-85.2348,116.769 -88.6465,117.419 -92.0397,118.066"/>
+<polygon fill="black" stroke="black" points="-91.666,121.558 -102.145,119.993 -92.9771,114.682 -91.666,121.558"/>
+</g>
+<!-- node34 -->
+<g id="node34" class="node"><title>node34</title>
+<polygon fill="white" stroke="black" points="69.9831,363.151 69.9831,291.151 209.973,291.151 209.973,363.151 69.9831,363.151"/>
+<text text-anchor="middle" x="139.978" y="306.351" font-family="Times,serif" font-size="14.00">tags</text>
+<polyline fill="none" stroke="black" points="69.9831,313.151 209.973,313.151 "/>
+<text text-anchor="start" x="77.9831" y="328.351" font-family="Times,serif" font-size="14.00">&#45; tagid integer [PA,U]</text>
+<text text-anchor="start" x="77.9831" y="342.351" font-family="Times,serif" font-size="14.00">&#45; cd integer [U]</text>
+<text text-anchor="start" x="77.9831" y="356.351" font-family="Times,serif" font-size="14.00">&#45; tag varchar(100) [U]</text>
+</g>
+<!-- node28&#45;&gt;node34 -->
+<g id="edge9" class="edge"><title>node28&#45;&gt;node34</title>
+<path fill="none" stroke="black" d="M41.1398,156.27C63.6635,195.211 93.0439,246.007 113.903,282.069"/>
+<polygon fill="black" stroke="black" points="117.035,280.495 119.013,290.904 110.976,284 117.035,280.495"/>
+</g>
+<!-- node28&#45;&gt;node35 -->
+<g id="edge7" class="edge"><title>node28&#45;&gt;node35</title>
+<path fill="none" stroke="black" d="M-52.8492,41.7187C-75.0193,20.8553 -99.6862,-2.35779 -120.316,-21.7714"/>
+<polygon fill="black" stroke="black" points="-122.837,-19.3383 -127.721,-28.7404 -118.04,-24.4361 -122.837,-19.3383"/>
+</g>
+<!-- node28&#45;&gt;node37 -->
+<g id="edge11" class="edge"><title>node28&#45;&gt;node37</title>
+<path fill="none" stroke="black" d="M9.02648,41.9548C9.54794,12.7349 10.1698,-22.1092 10.6375,-48.3171"/>
+<polygon fill="black" stroke="black" points="7.14339,-48.6846 10.8214,-58.6205 14.1423,-48.5597 7.14339,-48.6846"/>
+</g>
+<!-- node33 -->
+<g id="node33" class="node"><title>node33</title>
+<polygon fill="white" stroke="black" points="-432.737,308.794 -432.737,236.794 -278.329,236.794 -278.329,308.794 -432.737,308.794"/>
+<text text-anchor="middle" x="-355.533" y="251.994" font-family="Times,serif" font-size="14.00">lyric_versions</text>
+<polyline fill="none" stroke="black" points="-432.737,258.794 -278.329,258.794 "/>
+<text text-anchor="start" x="-424.737" y="273.994" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="-424.737" y="287.994" font-family="Times,serif" font-size="14.00">&#45; lyric_id integer [FK,U]</text>
+<text text-anchor="start" x="-424.737" y="301.994" font-family="Times,serif" font-size="14.00">&#45; text varchar(100) [U]</text>
+</g>
+<!-- node30&#45;&gt;node33 -->
+<g id="edge19" class="edge"><title>node30&#45;&gt;node33</title>
+<path fill="none" stroke="black" d="M-266.862,302.813C-267.449,302.614 -268.036,302.415 -268.624,302.216"/>
+<polygon fill="black" stroke="black" points="-269.818,305.507 -278.168,298.985 -267.574,298.877 -269.818,305.507"/>
+</g>
+<!-- node36 -->
+<g id="node36" class="node"><title>node36</title>
+<polygon fill="white" stroke="black" points="256.889,355.069 256.889,269.069 415.568,269.069 415.568,355.069 256.889,355.069"/>
+<text text-anchor="middle" x="336.229" y="284.269" font-family="Times,serif" font-size="14.00">images</text>
+<polyline fill="none" stroke="black" points="256.889,291.069 415.568,291.069 "/>
+<text text-anchor="start" x="264.889" y="306.269" font-family="Times,serif" font-size="14.00">&#45; id integer [PA]</text>
+<text text-anchor="start" x="264.889" y="320.269" font-family="Times,serif" font-size="14.00">&#45; artwork_id integer [FK]</text>
+<text text-anchor="start" x="264.889" y="334.269" font-family="Times,serif" font-size="14.00">&#45; name varchar(100)</text>
+<text text-anchor="start" x="264.889" y="348.269" font-family="Times,serif" font-size="14.00">&#45; data blob [N]</text>
+</g>
+<!-- node31&#45;&gt;node36 -->
+<g id="edge13" class="edge"><title>node31&#45;&gt;node36</title>
+<path fill="none" stroke="black" d="M194.587,175.536C217.621,197.74 253.958,232.765 284.059,261.781"/>
+<polygon fill="black" stroke="black" points="286.795,259.557 291.566,269.017 281.937,264.597 286.795,259.557"/>
+</g>
+<!-- node31&#45;&gt;node38 -->
+<g id="edge12" class="edge"><title>node31&#45;&gt;node38</title>
+<path fill="none" stroke="black" d="M235.947,138.63C236.166,138.58 236.386,138.529 236.607,138.478"/>
+<polygon fill="black" stroke="black" points="236.099,135.003 246.63,136.16 237.676,141.823 236.099,135.003"/>
+</g>
+<!-- node37&#45;&gt;node39 -->
+<g id="edge26" class="edge"><title>node37&#45;&gt;node39</title>
+<path fill="none" stroke="black" d="M27.3245,-116.995C36.2655,-133.368 47.8896,-154.655 59.3376,-175.62"/>
+<polygon fill="black" stroke="black" points="56.3602,-177.47 64.2248,-184.569 62.5039,-174.115 56.3602,-177.47"/>
+</g>
+</g>
+</svg>
index 7e69eea..d208394 100644 (file)
@@ -669,7 +669,8 @@ my $dbic_reqs = {
     req => {
       'ExtUtils::MakeMaker' => '6.64',
       'Pod::Inherit'        => '0.91',
-    },
+      'GraphViz'            => '0',
+    }
   },
 
   dist_upload => {
index 6096010..5d3bbba 100644 (file)
@@ -1,6 +1,8 @@
 require File::Spec;
 my $test_ddl_fn     = File::Spec->catfile(qw( t lib sqlite.sql ));
 my @test_ddl_cmd    = qw( -I lib -I t/lib -- maint/gen_sqlite_schema_files --schema-class DBICTest::Schema );
+my $test_graph_fn   = File::Spec->catfile(qw( examples DBICTest db-diagram.svg ));
+my @test_graph_cmd  = qw( -I lib -I t/lib -- maint/gen_dbictest_schema_diagram --schema-class DBICTest::Schema );
 
 my $example_ddl_fn  = File::Spec->catfile(qw( examples Schema db example.sql ));
 my $example_db_fn   = File::Spec->catfile(qw( examples Schema db example.db ));
@@ -15,6 +17,9 @@ if ( DBIx::Class::Optional::Dependencies->req_ok_for ('deploy') ) {
   print "Regenerating $test_ddl_fn\n";
   system( $^X, @test_ddl_cmd, '--ddl-out' => $test_ddl_fn );
 
+  print "Regenerating $test_graph_fn\n";
+  system( $^X, @test_graph_cmd, '--diagram-out' => $test_graph_fn );
+
   print "Regenerating $example_ddl_fn and $example_db_fn\n";
   system( $^X, @example_ddl_cmd, '--ddl-out' => $example_ddl_fn, '--deploy-to' => $example_db_fn );
 
diff --git a/maint/gen_dbictest_schema_diagram b/maint/gen_dbictest_schema_diagram
new file mode 100644 (file)
index 0000000..e2df755
--- /dev/null
@@ -0,0 +1,57 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use DBICTest;
+
+use Module::Runtime 'use_module';
+use SQL::Translator;
+use Path::Class 'file';
+use Getopt::Long;
+my $getopt = Getopt::Long::Parser->new(
+  config => [qw/gnu_getopt bundling_override no_ignore_case/]
+);
+my $args = {};
+$getopt->getoptions($args, qw/
+  diagram-out=s@
+  schema-class=s@
+/);
+
+die "You need to specify one diagram output filename via --diagram-out\n"
+  if @{$args->{'diagram-out'}||[]} != 1;
+
+die "You need to specify one DBIC schema class via --schema-class\n"
+  if @{$args->{'schema-class'}||[]} != 1;
+
+my $diagram_fh;
+if ($args->{'diagram-out'}[0] eq '-') {
+  $diagram_fh = *STDOUT;
+}
+else {
+  my $fn = file($args->{'diagram-out'}[0]);
+  $fn->dir->mkpath;
+  open $diagram_fh, '>', $fn
+    or die "Unable to open $fn: $!\n";
+}
+binmode $diagram_fh;  # avoid win32 \n crapfest
+
+my $schema_class = $args->{'schema-class'}[0];
+use_module( $schema_class );
+my $schema = $schema_class->connect( DBICTest->_database(quote_char => '"') );
+
+my $trans = SQL::Translator->new(
+  parser        => 'SQL::Translator::Parser::DBIx::Class',
+  parser_args   => { dbic_schema => $schema },
+  producer      => 'GraphViz',
+  producer_args => {
+    show_constraints => 1,
+    show_datatypes   => 1,
+    show_sizes       => 1,
+    out_file         => $diagram_fh,
+    output_type      => 'svg',
+    layout           => 'neato',
+  }
+);
+
+$trans->translate or die $trans->error;