dont use msre_id
authorgamesguru <mathmuncher11@gmail.com>
Mon, 28 Sep 2020 14:04:35 +0000 (10:04 -0400)
committergamesguru <mathmuncher11@gmail.com>
Tue, 29 Sep 2020 12:04:18 +0000 (08:04 -0400)
docs/nt.svg
sql/data/food_log.csv
sql/data/recipe_dat.csv
sql/export.sh [new file with mode: 0755]
sql/tables.sql

index c398c924089c3dd4c2c15bf3e118039392de8e2a..992660a8688cac97880ffaed44ef857f83495d4b 100644 (file)
 <!-- Generated by graphviz version 2.43.0 (0)
  -->
 <!-- Title: undefined Pages: 1 -->
-<svg width="1122pt" height="1240pt"
- viewBox="0.00 0.00 1121.60 1239.60" 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(28.8 1189.8)">
+<svg width="1126pt" height="1129pt"
+ viewBox="0.00 0.00 1125.60 1128.60" 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(28.8 1078.8)">
 <title>undefined</title>
-<polygon fill="white" stroke="transparent" points="-28.8,49.8 -28.8,-1189.8 1092.8,-1189.8 1092.8,49.8 -28.8,49.8"/>
-<text text-anchor="start" x="503.5" y="12.6" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">nt.sqlite</text>
+<polygon fill="white" stroke="transparent" points="-28.8,49.8 -28.8,-1078.8 1096.8,-1078.8 1096.8,49.8 -28.8,49.8"/>
+<text text-anchor="start" x="505.5" y="12.6" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">nt.sqlite</text>
 <!-- version -->
 <g id="node1" class="node">
 <title>version</title>
-<path fill="none" stroke="black" d="M786.24,-860.64C786.24,-860.64 906.24,-860.64 906.24,-860.64 912.24,-860.64 918.24,-866.64 918.24,-872.64 918.24,-872.64 918.24,-952.64 918.24,-952.64 918.24,-958.64 912.24,-964.64 906.24,-964.64 906.24,-964.64 786.24,-964.64 786.24,-964.64 780.24,-964.64 774.24,-958.64 774.24,-952.64 774.24,-952.64 774.24,-872.64 774.24,-872.64 774.24,-866.64 780.24,-860.64 786.24,-860.64"/>
-<text text-anchor="start" x="819.24" y="-944.24" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">version</text>
-<polyline fill="none" stroke="black" points="774.24,-934.64 918.24,-934.64 "/>
-<text text-anchor="start" x="781.24" y="-921.04" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
-<text text-anchor="start" x="802.24" y="-921.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
-<text text-anchor="start" x="781.24" y="-904.04" font-family="Helvetica,sans-Serif" font-size="12.00">version </text>
-<text text-anchor="start" x="829.24" y="-904.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
-<text text-anchor="start" x="781.24" y="-887.04" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
-<text text-anchor="start" x="831.24" y="-887.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
-<text text-anchor="start" x="781.24" y="-870.04" font-family="Helvetica,sans-Serif" font-size="12.00">notes </text>
-<text text-anchor="start" x="818.24" y="-870.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<path fill="none" stroke="black" d="M213.24,-871.64C213.24,-871.64 333.24,-871.64 333.24,-871.64 339.24,-871.64 345.24,-877.64 345.24,-883.64 345.24,-883.64 345.24,-963.64 345.24,-963.64 345.24,-969.64 339.24,-975.64 333.24,-975.64 333.24,-975.64 213.24,-975.64 213.24,-975.64 207.24,-975.64 201.24,-969.64 201.24,-963.64 201.24,-963.64 201.24,-883.64 201.24,-883.64 201.24,-877.64 207.24,-871.64 213.24,-871.64"/>
+<text text-anchor="start" x="246.24" y="-955.24" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">version</text>
+<polyline fill="none" stroke="black" points="201.24,-945.64 345.24,-945.64 "/>
+<text text-anchor="start" x="208.24" y="-932.04" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="229.24" y="-932.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="208.24" y="-915.04" font-family="Helvetica,sans-Serif" font-size="12.00">version </text>
+<text text-anchor="start" x="256.24" y="-915.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="208.24" y="-898.04" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
+<text text-anchor="start" x="258.24" y="-898.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
+<text text-anchor="start" x="208.24" y="-881.04" font-family="Helvetica,sans-Serif" font-size="12.00">notes </text>
+<text text-anchor="start" x="245.24" y="-881.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- bmr_eqs -->
 <g id="node2" class="node">
 <title>bmr_eqs</title>
-<path fill="none" stroke="black" d="M18.8,-589.13C18.8,-589.13 138.8,-589.13 138.8,-589.13 144.8,-589.13 150.8,-595.13 150.8,-601.13 150.8,-601.13 150.8,-647.13 150.8,-647.13 150.8,-653.13 144.8,-659.13 138.8,-659.13 138.8,-659.13 18.8,-659.13 18.8,-659.13 12.8,-659.13 6.8,-653.13 6.8,-647.13 6.8,-647.13 6.8,-601.13 6.8,-601.13 6.8,-595.13 12.8,-589.13 18.8,-589.13"/>
-<text text-anchor="start" x="47.8" y="-638.73" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">bmr_eqs</text>
-<polyline fill="none" stroke="black" points="6.8,-629.13 150.8,-629.13 "/>
-<text text-anchor="start" x="13.8" y="-615.53" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
-<text text-anchor="start" x="34.8" y="-615.53" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
-<text text-anchor="start" x="13.8" y="-598.53" font-family="Helvetica,sans-Serif" font-size="12.00">bmr_eq </text>
-<text text-anchor="start" x="63.8" y="-598.53" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<path fill="none" stroke="black" d="M296.01,-457.68C296.01,-457.68 416.01,-457.68 416.01,-457.68 422.01,-457.68 428.01,-463.68 428.01,-469.68 428.01,-469.68 428.01,-515.68 428.01,-515.68 428.01,-521.68 422.01,-527.68 416.01,-527.68 416.01,-527.68 296.01,-527.68 296.01,-527.68 290.01,-527.68 284.01,-521.68 284.01,-515.68 284.01,-515.68 284.01,-469.68 284.01,-469.68 284.01,-463.68 290.01,-457.68 296.01,-457.68"/>
+<text text-anchor="start" x="325.01" y="-507.28" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">bmr_eqs</text>
+<polyline fill="none" stroke="black" points="284.01,-497.68 428.01,-497.68 "/>
+<text text-anchor="start" x="291.01" y="-484.08" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="312.01" y="-484.08" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="291.01" y="-467.08" font-family="Helvetica,sans-Serif" font-size="12.00">bmr_eq </text>
+<text text-anchor="start" x="341.01" y="-467.08" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- bf_eqs -->
 <g id="node3" class="node">
 <title>bf_eqs</title>
-<path fill="none" stroke="black" d="M748.8,-666.35C748.8,-666.35 868.8,-666.35 868.8,-666.35 874.8,-666.35 880.8,-672.35 880.8,-678.35 880.8,-678.35 880.8,-724.35 880.8,-724.35 880.8,-730.35 874.8,-736.35 868.8,-736.35 868.8,-736.35 748.8,-736.35 748.8,-736.35 742.8,-736.35 736.8,-730.35 736.8,-724.35 736.8,-724.35 736.8,-678.35 736.8,-678.35 736.8,-672.35 742.8,-666.35 748.8,-666.35"/>
-<text text-anchor="start" x="784.8" y="-715.95" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">bf_eqs</text>
-<polyline fill="none" stroke="black" points="736.8,-706.35 880.8,-706.35 "/>
-<text text-anchor="start" x="743.8" y="-692.75" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
-<text text-anchor="start" x="764.8" y="-692.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
-<text text-anchor="start" x="743.8" y="-675.75" font-family="Helvetica,sans-Serif" font-size="12.00">bf_eq </text>
-<text text-anchor="start" x="780.8" y="-675.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<path fill="none" stroke="black" d="M935.69,-512.95C935.69,-512.95 1055.69,-512.95 1055.69,-512.95 1061.69,-512.95 1067.69,-518.95 1067.69,-524.95 1067.69,-524.95 1067.69,-570.95 1067.69,-570.95 1067.69,-576.95 1061.69,-582.95 1055.69,-582.95 1055.69,-582.95 935.69,-582.95 935.69,-582.95 929.69,-582.95 923.69,-576.95 923.69,-570.95 923.69,-570.95 923.69,-524.95 923.69,-524.95 923.69,-518.95 929.69,-512.95 935.69,-512.95"/>
+<text text-anchor="start" x="971.69" y="-562.55" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">bf_eqs</text>
+<polyline fill="none" stroke="black" points="923.69,-552.95 1067.69,-552.95 "/>
+<text text-anchor="start" x="930.69" y="-539.35" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="951.69" y="-539.35" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="930.69" y="-522.35" font-family="Helvetica,sans-Serif" font-size="12.00">bf_eq </text>
+<text text-anchor="start" x="967.69" y="-522.35" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- users -->
 <g id="node4" class="node">
 <title>users</title>
-<path fill="none" stroke="black" d="M450.37,-394.85C450.37,-394.85 570.37,-394.85 570.37,-394.85 576.37,-394.85 582.37,-400.85 582.37,-406.85 582.37,-406.85 582.37,-605.85 582.37,-605.85 582.37,-611.85 576.37,-617.85 570.37,-617.85 570.37,-617.85 450.37,-617.85 450.37,-617.85 444.37,-617.85 438.37,-611.85 438.37,-605.85 438.37,-605.85 438.37,-406.85 438.37,-406.85 438.37,-400.85 444.37,-394.85 450.37,-394.85"/>
-<text text-anchor="start" x="490.37" y="-597.45" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">users</text>
-<polyline fill="none" stroke="black" points="438.37,-587.85 582.37,-587.85 "/>
-<text text-anchor="start" x="445.37" y="-573.75" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
-<text text-anchor="start" x="466.37" y="-573.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
-<text text-anchor="start" x="445.37" y="-556.75" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
-<text text-anchor="start" x="484.37" y="-556.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
-<text text-anchor="start" x="445.37" y="-539.75" font-family="Helvetica,sans-Serif" font-size="12.00">eula </text>
-<text text-anchor="start" x="475.37" y="-539.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="445.37" y="-522.75" font-family="Helvetica,sans-Serif" font-size="12.00">gender </text>
-<text text-anchor="start" x="492.37" y="-522.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
-<text text-anchor="start" x="445.37" y="-505.75" font-family="Helvetica,sans-Serif" font-size="12.00">dob </text>
-<text text-anchor="start" x="472.37" y="-505.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
-<text text-anchor="start" x="445.37" y="-488.75" font-family="Helvetica,sans-Serif" font-size="12.00">act_lvl </text>
-<text text-anchor="start" x="487.37" y="-488.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="445.37" y="-471.75" font-family="Helvetica,sans-Serif" font-size="12.00">goal_wt </text>
-<text text-anchor="start" x="495.37" y="-471.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
-<text text-anchor="start" x="445.37" y="-454.75" font-family="Helvetica,sans-Serif" font-size="12.00">goal_bf </text>
-<text text-anchor="start" x="493.37" y="-454.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
-<text text-anchor="start" x="445.37" y="-437.75" font-family="Helvetica,sans-Serif" font-size="12.00">bmr_id </text>
-<text text-anchor="start" x="491.37" y="-437.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="445.37" y="-420.75" font-family="Helvetica,sans-Serif" font-size="12.00">bf_id </text>
-<text text-anchor="start" x="478.37" y="-420.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="445.37" y="-403.75" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
-<text text-anchor="start" x="495.37" y="-403.75" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<path fill="none" stroke="black" d="M649.09,-415.75C649.09,-415.75 769.09,-415.75 769.09,-415.75 775.09,-415.75 781.09,-421.75 781.09,-427.75 781.09,-427.75 781.09,-643.75 781.09,-643.75 781.09,-649.75 775.09,-655.75 769.09,-655.75 769.09,-655.75 649.09,-655.75 649.09,-655.75 643.09,-655.75 637.09,-649.75 637.09,-643.75 637.09,-643.75 637.09,-427.75 637.09,-427.75 637.09,-421.75 643.09,-415.75 649.09,-415.75"/>
+<text text-anchor="start" x="689.09" y="-635.35" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">users</text>
+<polyline fill="none" stroke="black" points="637.09,-625.75 781.09,-625.75 "/>
+<text text-anchor="start" x="644.09" y="-612.15" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="665.09" y="-612.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="644.09" y="-595.15" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
+<text text-anchor="start" x="683.09" y="-595.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="644.09" y="-578.15" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="674.09" y="-578.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="644.09" y="-561.15" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
+<text text-anchor="start" x="694.09" y="-561.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="644.09" y="-544.15" font-family="Helvetica,sans-Serif" font-size="12.00">eula </text>
+<text text-anchor="start" x="674.09" y="-544.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="644.09" y="-527.15" font-family="Helvetica,sans-Serif" font-size="12.00">gender </text>
+<text text-anchor="start" x="691.09" y="-527.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="644.09" y="-510.15" font-family="Helvetica,sans-Serif" font-size="12.00">dob </text>
+<text text-anchor="start" x="671.09" y="-510.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
+<text text-anchor="start" x="644.09" y="-493.15" font-family="Helvetica,sans-Serif" font-size="12.00">act_lvl </text>
+<text text-anchor="start" x="686.09" y="-493.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="644.09" y="-476.15" font-family="Helvetica,sans-Serif" font-size="12.00">goal_wt </text>
+<text text-anchor="start" x="694.09" y="-476.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="644.09" y="-459.15" font-family="Helvetica,sans-Serif" font-size="12.00">goal_bf </text>
+<text text-anchor="start" x="692.09" y="-459.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="644.09" y="-442.15" font-family="Helvetica,sans-Serif" font-size="12.00">bmr_id </text>
+<text text-anchor="start" x="690.09" y="-442.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="644.09" y="-425.15" font-family="Helvetica,sans-Serif" font-size="12.00">bf_id </text>
+<text text-anchor="start" x="677.09" y="-425.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
 </g>
 <!-- users&#45;&gt;bmr_eqs -->
 <g id="edge2" class="edge">
 <title>users&#45;&gt;bmr_eqs</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M438.13,-526.06C361,-547.12 239.07,-580.39 159,-602.24"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="157.89,-599.64 150.91,-604.45 159.36,-605.05 157.89,-599.64"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M636.79,-526.93C578.48,-519.82 496.52,-509.82 436.2,-502.46"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="436.49,-499.68 428.21,-501.49 435.82,-505.23 436.49,-499.68"/>
 </g>
 <!-- users&#45;&gt;bf_eqs -->
 <g id="edge1" class="edge">
 <title>users&#45;&gt;bf_eqs</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M582.61,-553.55C633.25,-586.64 700.18,-630.37 748.07,-661.67"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="746.77,-664.16 755,-666.19 749.83,-659.47 746.77,-664.16"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M781.41,-538.83C822.23,-540.57 873.32,-542.74 915.38,-544.53"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="915.28,-547.33 923.4,-544.88 915.52,-541.74 915.28,-547.33"/>
 </g>
 <!-- biometrics -->
 <g id="node5" class="node">
 <title>biometrics</title>
-<path fill="none" stroke="black" d="M510.35,-1056.89C510.35,-1056.89 630.35,-1056.89 630.35,-1056.89 636.35,-1056.89 642.35,-1062.89 642.35,-1068.89 642.35,-1068.89 642.35,-1148.89 642.35,-1148.89 642.35,-1154.89 636.35,-1160.89 630.35,-1160.89 630.35,-1160.89 510.35,-1160.89 510.35,-1160.89 504.35,-1160.89 498.35,-1154.89 498.35,-1148.89 498.35,-1148.89 498.35,-1068.89 498.35,-1068.89 498.35,-1062.89 504.35,-1056.89 510.35,-1056.89"/>
-<text text-anchor="start" x="531.35" y="-1140.49" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">biometrics</text>
-<polyline fill="none" stroke="black" points="498.35,-1130.89 642.35,-1130.89 "/>
-<text text-anchor="start" x="505.35" y="-1117.29" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
-<text text-anchor="start" x="526.35" y="-1117.29" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
-<text text-anchor="start" x="505.35" y="-1100.29" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
-<text text-anchor="start" x="544.35" y="-1100.29" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
-<text text-anchor="start" x="505.35" y="-1083.29" font-family="Helvetica,sans-Serif" font-size="12.00">unit </text>
-<text text-anchor="start" x="532.35" y="-1083.29" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
-<text text-anchor="start" x="505.35" y="-1066.29" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
-<text text-anchor="start" x="555.35" y="-1066.29" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<path fill="none" stroke="black" d="M454.77,-945.13C454.77,-945.13 574.77,-945.13 574.77,-945.13 580.77,-945.13 586.77,-951.13 586.77,-957.13 586.77,-957.13 586.77,-1037.13 586.77,-1037.13 586.77,-1043.13 580.77,-1049.13 574.77,-1049.13 574.77,-1049.13 454.77,-1049.13 454.77,-1049.13 448.77,-1049.13 442.77,-1043.13 442.77,-1037.13 442.77,-1037.13 442.77,-957.13 442.77,-957.13 442.77,-951.13 448.77,-945.13 454.77,-945.13"/>
+<text text-anchor="start" x="475.77" y="-1028.73" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">biometrics</text>
+<polyline fill="none" stroke="black" points="442.77,-1019.13 586.77,-1019.13 "/>
+<text text-anchor="start" x="449.77" y="-1005.53" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="470.77" y="-1005.53" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="449.77" y="-988.53" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
+<text text-anchor="start" x="488.77" y="-988.53" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="449.77" y="-971.53" font-family="Helvetica,sans-Serif" font-size="12.00">unit </text>
+<text text-anchor="start" x="476.77" y="-971.53" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="449.77" y="-954.53" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
+<text text-anchor="start" x="499.77" y="-954.53" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
 </g>
 <!-- biometric_log -->
 <g id="node6" class="node">
 <title>biometric_log</title>
-<path fill="none" stroke="black" d="M403.76,-801.69C403.76,-801.69 523.76,-801.69 523.76,-801.69 529.76,-801.69 535.76,-807.69 535.76,-813.69 535.76,-813.69 535.76,-927.69 535.76,-927.69 535.76,-933.69 529.76,-939.69 523.76,-939.69 523.76,-939.69 403.76,-939.69 403.76,-939.69 397.76,-939.69 391.76,-933.69 391.76,-927.69 391.76,-927.69 391.76,-813.69 391.76,-813.69 391.76,-807.69 397.76,-801.69 403.76,-801.69"/>
-<text text-anchor="start" x="413.76" y="-919.29" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">biometric_log</text>
-<polyline fill="none" stroke="black" points="391.76,-909.69 535.76,-909.69 "/>
-<text text-anchor="start" x="398.76" y="-896.09" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
-<text text-anchor="start" x="419.76" y="-896.09" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
-<text text-anchor="start" x="398.76" y="-879.09" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
-<text text-anchor="start" x="428.76" y="-879.09" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
-<text text-anchor="start" x="398.76" y="-862.09" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
-<text text-anchor="start" x="445.76" y="-862.09" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="398.76" y="-845.09" font-family="Helvetica,sans-Serif" font-size="12.00">date </text>
-<text text-anchor="start" x="429.76" y="-845.09" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
-<text text-anchor="start" x="398.76" y="-828.09" font-family="Helvetica,sans-Serif" font-size="12.00">biometric_id </text>
-<text text-anchor="start" x="476.76" y="-828.09" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="398.76" y="-811.09" font-family="Helvetica,sans-Serif" font-size="12.00">value </text>
-<text text-anchor="start" x="435.76" y="-811.09" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<path fill="none" stroke="black" d="M446.34,-722.99C446.34,-722.99 566.34,-722.99 566.34,-722.99 572.34,-722.99 578.34,-728.99 578.34,-734.99 578.34,-734.99 578.34,-848.99 578.34,-848.99 578.34,-854.99 572.34,-860.99 566.34,-860.99 566.34,-860.99 446.34,-860.99 446.34,-860.99 440.34,-860.99 434.34,-854.99 434.34,-848.99 434.34,-848.99 434.34,-734.99 434.34,-734.99 434.34,-728.99 440.34,-722.99 446.34,-722.99"/>
+<text text-anchor="start" x="456.34" y="-840.59" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">biometric_log</text>
+<polyline fill="none" stroke="black" points="434.34,-830.99 578.34,-830.99 "/>
+<text text-anchor="start" x="441.34" y="-817.39" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="462.34" y="-817.39" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="441.34" y="-800.39" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="471.34" y="-800.39" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="441.34" y="-783.39" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
+<text text-anchor="start" x="488.34" y="-783.39" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="441.34" y="-766.39" font-family="Helvetica,sans-Serif" font-size="12.00">date </text>
+<text text-anchor="start" x="472.34" y="-766.39" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
+<text text-anchor="start" x="441.34" y="-749.39" font-family="Helvetica,sans-Serif" font-size="12.00">biometric_id </text>
+<text text-anchor="start" x="519.34" y="-749.39" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="441.34" y="-732.39" font-family="Helvetica,sans-Serif" font-size="12.00">value </text>
+<text text-anchor="start" x="478.34" y="-732.39" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
 </g>
 <!-- biometric_log&#45;&gt;users -->
 <g id="edge4" class="edge">
 <title>biometric_log&#45;&gt;users</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M472.63,-801.31C478.95,-751.91 487.61,-684.27 495.03,-626.23"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="497.83,-626.4 496.07,-618.11 492.28,-625.69 497.83,-626.4"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M560.94,-722.99C582.73,-695.45 608.21,-663.24 631.84,-633.38"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="634.08,-635.06 636.85,-627.05 629.69,-631.58 634.08,-635.06"/>
 </g>
 <!-- biometric_log&#45;&gt;biometrics -->
 <g id="edge3" class="edge">
 <title>biometric_log&#45;&gt;biometrics</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M494.73,-939.91C510.22,-974.52 528.77,-1015.98 543.63,-1049.18"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="541.11,-1050.4 546.93,-1056.56 546.22,-1048.11 541.11,-1050.4"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M509.18,-861.16C510.19,-885.71 511.31,-913.14 512.29,-936.89"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="509.5,-937.25 512.63,-945.12 515.1,-937.02 509.5,-937.25"/>
 </g>
 <!-- recipes -->
 <g id="node7" class="node">
 <title>recipes</title>
-<path fill="none" stroke="black" d="M295.84,-240.83C295.84,-240.83 415.84,-240.83 415.84,-240.83 421.84,-240.83 427.84,-246.83 427.84,-252.83 427.84,-252.83 427.84,-349.83 427.84,-349.83 427.84,-355.83 421.84,-361.83 415.84,-361.83 415.84,-361.83 295.84,-361.83 295.84,-361.83 289.84,-361.83 283.84,-355.83 283.84,-349.83 283.84,-349.83 283.84,-252.83 283.84,-252.83 283.84,-246.83 289.84,-240.83 295.84,-240.83"/>
-<text text-anchor="start" x="328.84" y="-341.43" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">recipes</text>
-<polyline fill="none" stroke="black" points="283.84,-331.83 427.84,-331.83 "/>
-<text text-anchor="start" x="290.84" y="-317.73" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
-<text text-anchor="start" x="311.84" y="-317.73" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
-<text text-anchor="start" x="290.84" y="-300.73" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
-<text text-anchor="start" x="320.84" y="-300.73" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
-<text text-anchor="start" x="290.84" y="-283.73" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
-<text text-anchor="start" x="337.84" y="-283.73" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="290.84" y="-266.73" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
-<text text-anchor="start" x="329.84" y="-266.73" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
-<text text-anchor="start" x="290.84" y="-249.73" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
-<text text-anchor="start" x="340.84" y="-249.73" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-</g>
-<!-- recipes&#45;&gt;users -->
-<g id="edge5" class="edge">
-<title>recipes&#45;&gt;users</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M401.57,-362.01C411.53,-375.22 422.33,-389.55 433.13,-403.87"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="431.04,-405.75 438.09,-410.45 435.51,-402.38 431.04,-405.75"/>
+<path fill="none" stroke="black" d="M271.25,-86.49C271.25,-86.49 391.25,-86.49 391.25,-86.49 397.25,-86.49 403.25,-92.49 403.25,-98.49 403.25,-98.49 403.25,-178.49 403.25,-178.49 403.25,-184.49 397.25,-190.49 391.25,-190.49 391.25,-190.49 271.25,-190.49 271.25,-190.49 265.25,-190.49 259.25,-184.49 259.25,-178.49 259.25,-178.49 259.25,-98.49 259.25,-98.49 259.25,-92.49 265.25,-86.49 271.25,-86.49"/>
+<text text-anchor="start" x="304.25" y="-170.09" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">recipes</text>
+<polyline fill="none" stroke="black" points="259.25,-160.49 403.25,-160.49 "/>
+<text text-anchor="start" x="266.25" y="-146.89" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="287.25" y="-146.89" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="266.25" y="-129.89" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="296.25" y="-129.89" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="266.25" y="-112.89" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
+<text text-anchor="start" x="316.25" y="-112.89" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="266.25" y="-95.89" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
+<text text-anchor="start" x="305.25" y="-95.89" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- recipe_dat -->
 <g id="node8" class="node">
 <title>recipe_dat</title>
-<path fill="none" stroke="black" d="M12.47,-52.46C12.47,-52.46 132.47,-52.46 132.47,-52.46 138.47,-52.46 144.47,-58.46 144.47,-64.46 144.47,-64.46 144.47,-144.46 144.47,-144.46 144.47,-150.46 138.47,-156.46 132.47,-156.46 132.47,-156.46 12.47,-156.46 12.47,-156.46 6.47,-156.46 0.47,-150.46 0.47,-144.46 0.47,-144.46 0.47,-64.46 0.47,-64.46 0.47,-58.46 6.47,-52.46 12.47,-52.46"/>
-<text text-anchor="start" x="34.47" y="-136.06" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">recipe_dat</text>
-<polyline fill="none" stroke="black" points="0.47,-126.46 144.47,-126.46 "/>
-<text text-anchor="start" x="7.47" y="-112.86" font-family="Helvetica,sans-Serif" font-size="12.00">recipe_id </text>
-<text text-anchor="start" x="65.47" y="-112.86" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="7.47" y="-95.86" font-family="Helvetica,sans-Serif" font-size="12.00">food_id </text>
-<text text-anchor="start" x="55.47" y="-95.86" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="7.47" y="-78.86" font-family="Helvetica,sans-Serif" font-size="12.00">grams </text>
-<text text-anchor="start" x="50.47" y="-78.86" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
-<text text-anchor="start" x="7.47" y="-61.86" font-family="Helvetica,sans-Serif" font-size="12.00">notes </text>
-<text text-anchor="start" x="44.47" y="-61.86" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<path fill="none" stroke="black" d="M11.93,-229.65C11.93,-229.65 131.93,-229.65 131.93,-229.65 137.93,-229.65 143.93,-235.65 143.93,-241.65 143.93,-241.65 143.93,-321.65 143.93,-321.65 143.93,-327.65 137.93,-333.65 131.93,-333.65 131.93,-333.65 11.93,-333.65 11.93,-333.65 5.93,-333.65 -0.07,-327.65 -0.07,-321.65 -0.07,-321.65 -0.07,-241.65 -0.07,-241.65 -0.07,-235.65 5.93,-229.65 11.93,-229.65"/>
+<text text-anchor="start" x="33.93" y="-313.25" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">recipe_dat</text>
+<polyline fill="none" stroke="black" points="-0.07,-303.65 143.93,-303.65 "/>
+<text text-anchor="start" x="6.93" y="-290.05" font-family="Helvetica,sans-Serif" font-size="12.00">recipe_id </text>
+<text text-anchor="start" x="64.93" y="-290.05" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="6.93" y="-273.05" font-family="Helvetica,sans-Serif" font-size="12.00">food_id </text>
+<text text-anchor="start" x="54.93" y="-273.05" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="6.93" y="-256.05" font-family="Helvetica,sans-Serif" font-size="12.00">grams </text>
+<text text-anchor="start" x="49.93" y="-256.05" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="6.93" y="-239.05" font-family="Helvetica,sans-Serif" font-size="12.00">notes </text>
+<text text-anchor="start" x="43.93" y="-239.05" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- recipe_dat&#45;&gt;recipes -->
-<g id="edge6" class="edge">
+<g id="edge5" class="edge">
 <title>recipe_dat&#45;&gt;recipes</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M144.71,-154.64C185.17,-182.76 235.69,-217.85 277.15,-246.66"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="275.56,-248.97 283.73,-251.23 278.76,-244.37 275.56,-248.97"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M144.16,-241.77C177.6,-223.31 217.43,-201.32 251.72,-182.39"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="253.3,-184.72 258.95,-178.4 250.6,-179.82 253.3,-184.72"/>
 </g>
 <!-- meal_names -->
 <g id="node9" class="node">
 <title>meal_names</title>
-<path fill="none" stroke="black" d="M931.54,-104.77C931.54,-104.77 1051.54,-104.77 1051.54,-104.77 1057.54,-104.77 1063.54,-110.77 1063.54,-116.77 1063.54,-116.77 1063.54,-162.77 1063.54,-162.77 1063.54,-168.77 1057.54,-174.77 1051.54,-174.77 1051.54,-174.77 931.54,-174.77 931.54,-174.77 925.54,-174.77 919.54,-168.77 919.54,-162.77 919.54,-162.77 919.54,-116.77 919.54,-116.77 919.54,-110.77 925.54,-104.77 931.54,-104.77"/>
-<text text-anchor="start" x="946.54" y="-154.37" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">meal_names</text>
-<polyline fill="none" stroke="black" points="919.54,-144.77 1063.54,-144.77 "/>
-<text text-anchor="start" x="926.54" y="-131.17" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
-<text text-anchor="start" x="947.54" y="-131.17" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
-<text text-anchor="start" x="926.54" y="-114.17" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
-<text text-anchor="start" x="965.54" y="-114.17" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<path fill="none" stroke="black" d="M654.32,-0.99C654.32,-0.99 774.32,-0.99 774.32,-0.99 780.32,-0.99 786.32,-6.99 786.32,-12.99 786.32,-12.99 786.32,-58.99 786.32,-58.99 786.32,-64.99 780.32,-70.99 774.32,-70.99 774.32,-70.99 654.32,-70.99 654.32,-70.99 648.32,-70.99 642.32,-64.99 642.32,-58.99 642.32,-58.99 642.32,-12.99 642.32,-12.99 642.32,-6.99 648.32,-0.99 654.32,-0.99"/>
+<text text-anchor="start" x="669.32" y="-50.59" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">meal_names</text>
+<polyline fill="none" stroke="black" points="642.32,-40.99 786.32,-40.99 "/>
+<text text-anchor="start" x="649.32" y="-27.39" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="670.32" y="-27.39" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="649.32" y="-10.39" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
+<text text-anchor="start" x="688.32" y="-10.39" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- food_log -->
 <g id="node10" class="node">
 <title>food_log</title>
-<path fill="none" stroke="black" d="M633.13,-231.21C633.13,-231.21 753.13,-231.21 753.13,-231.21 759.13,-231.21 765.13,-237.21 765.13,-243.21 765.13,-243.21 765.13,-408.21 765.13,-408.21 765.13,-414.21 759.13,-420.21 753.13,-420.21 753.13,-420.21 633.13,-420.21 633.13,-420.21 627.13,-420.21 621.13,-414.21 621.13,-408.21 621.13,-408.21 621.13,-243.21 621.13,-243.21 621.13,-237.21 627.13,-231.21 633.13,-231.21"/>
-<text text-anchor="start" x="662.13" y="-399.81" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">food_log</text>
-<polyline fill="none" stroke="black" points="621.13,-390.21 765.13,-390.21 "/>
-<text text-anchor="start" x="628.13" y="-376.11" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
-<text text-anchor="start" x="649.13" y="-376.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
-<text text-anchor="start" x="628.13" y="-359.11" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
-<text text-anchor="start" x="658.13" y="-359.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
-<text text-anchor="start" x="628.13" y="-342.11" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
-<text text-anchor="start" x="675.13" y="-342.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="628.13" y="-325.11" font-family="Helvetica,sans-Serif" font-size="12.00">date </text>
-<text text-anchor="start" x="659.13" y="-325.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
-<text text-anchor="start" x="628.13" y="-308.11" font-family="Helvetica,sans-Serif" font-size="12.00">meal_id </text>
-<text text-anchor="start" x="679.13" y="-308.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="628.13" y="-291.11" font-family="Helvetica,sans-Serif" font-size="12.00">amount </text>
-<text text-anchor="start" x="679.13" y="-291.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
-<text text-anchor="start" x="628.13" y="-274.11" font-family="Helvetica,sans-Serif" font-size="12.00">recipe_id </text>
-<text text-anchor="start" x="686.13" y="-274.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="628.13" y="-257.11" font-family="Helvetica,sans-Serif" font-size="12.00">food_id </text>
-<text text-anchor="start" x="676.13" y="-257.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="628.13" y="-240.11" font-family="Helvetica,sans-Serif" font-size="12.00">food_msre_id </text>
-<text text-anchor="start" x="712.13" y="-240.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<path fill="none" stroke="black" d="M803.79,-227.73C803.79,-227.73 923.79,-227.73 923.79,-227.73 929.79,-227.73 935.79,-233.73 935.79,-239.73 935.79,-239.73 935.79,-370.73 935.79,-370.73 935.79,-376.73 929.79,-382.73 923.79,-382.73 923.79,-382.73 803.79,-382.73 803.79,-382.73 797.79,-382.73 791.79,-376.73 791.79,-370.73 791.79,-370.73 791.79,-239.73 791.79,-239.73 791.79,-233.73 797.79,-227.73 803.79,-227.73"/>
+<text text-anchor="start" x="832.79" y="-362.33" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">food_log</text>
+<polyline fill="none" stroke="black" points="791.79,-352.73 935.79,-352.73 "/>
+<text text-anchor="start" x="798.79" y="-338.63" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="819.79" y="-338.63" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="798.79" y="-321.63" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="828.79" y="-321.63" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="798.79" y="-304.63" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
+<text text-anchor="start" x="845.79" y="-304.63" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="798.79" y="-287.63" font-family="Helvetica,sans-Serif" font-size="12.00">date </text>
+<text text-anchor="start" x="829.79" y="-287.63" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
+<text text-anchor="start" x="798.79" y="-270.63" font-family="Helvetica,sans-Serif" font-size="12.00">meal_id </text>
+<text text-anchor="start" x="849.79" y="-270.63" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="798.79" y="-253.63" font-family="Helvetica,sans-Serif" font-size="12.00">grams </text>
+<text text-anchor="start" x="841.79" y="-253.63" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="798.79" y="-236.63" font-family="Helvetica,sans-Serif" font-size="12.00">food_id </text>
+<text text-anchor="start" x="846.79" y="-236.63" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
 </g>
 <!-- food_log&#45;&gt;users -->
-<g id="edge9" class="edge">
-<title>food_log&#45;&gt;users</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M620.9,-397.1C610.21,-407.67 599.15,-418.6 588.35,-429.28"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="586.1,-427.56 582.38,-435.18 590.03,-431.55 586.1,-427.56"/>
-</g>
-<!-- food_log&#45;&gt;recipes -->
 <g id="edge7" class="edge">
-<title>food_log&#45;&gt;recipes</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M620.77,-320.48C566.53,-316.56 492.3,-311.19 436.21,-307.14"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="436.26,-304.34 428.07,-306.55 435.85,-309.92 436.26,-304.34"/>
+<title>food_log&#45;&gt;users</title>
+<path fill="none" stroke="black" stroke-width="0.9" d="M811.63,-382.95C803.34,-395.31 794.61,-408.31 785.9,-421.29"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="783.48,-419.88 781.35,-428.08 788.13,-423 783.48,-419.88"/>
 </g>
 <!-- food_log&#45;&gt;meal_names -->
-<g id="edge8" class="edge">
+<g id="edge6" class="edge">
 <title>food_log&#45;&gt;meal_names</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M765.37,-280.7C815.02,-249.76 880.33,-209.07 928,-179.36"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="929.59,-181.67 934.9,-175.06 926.63,-176.92 929.59,-181.67"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M820.76,-227.71C793.8,-179.16 760.1,-118.44 737.92,-78.5"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="740.25,-76.93 733.92,-71.29 735.36,-79.64 740.25,-76.93"/>
 </g>
-<!-- rda -->
+<!-- recipe_log -->
 <g id="node11" class="node">
+<title>recipe_log</title>
+<path fill="none" stroke="black" d="M463.65,-169.66C463.65,-169.66 583.65,-169.66 583.65,-169.66 589.65,-169.66 595.65,-175.66 595.65,-181.66 595.65,-181.66 595.65,-312.66 595.65,-312.66 595.65,-318.66 589.65,-324.66 583.65,-324.66 583.65,-324.66 463.65,-324.66 463.65,-324.66 457.65,-324.66 451.65,-318.66 451.65,-312.66 451.65,-312.66 451.65,-181.66 451.65,-181.66 451.65,-175.66 457.65,-169.66 463.65,-169.66"/>
+<text text-anchor="start" x="485.65" y="-304.26" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">recipe_log</text>
+<polyline fill="none" stroke="black" points="451.65,-294.66 595.65,-294.66 "/>
+<text text-anchor="start" x="458.65" y="-280.56" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="479.65" y="-280.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="458.65" y="-263.56" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="488.65" y="-263.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="458.65" y="-246.56" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
+<text text-anchor="start" x="505.65" y="-246.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="458.65" y="-229.56" font-family="Helvetica,sans-Serif" font-size="12.00">date </text>
+<text text-anchor="start" x="489.65" y="-229.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
+<text text-anchor="start" x="458.65" y="-212.56" font-family="Helvetica,sans-Serif" font-size="12.00">meal_id </text>
+<text text-anchor="start" x="509.65" y="-212.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="458.65" y="-195.56" font-family="Helvetica,sans-Serif" font-size="12.00">grams </text>
+<text text-anchor="start" x="501.65" y="-195.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="458.65" y="-178.56" font-family="Helvetica,sans-Serif" font-size="12.00">recipe_id </text>
+<text text-anchor="start" x="516.65" y="-178.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+</g>
+<!-- recipe_log&#45;&gt;users -->
+<g id="edge10" class="edge">
+<title>recipe_log&#45;&gt;users</title>
+<path fill="none" stroke="black" stroke-width="0.9" d="M573.59,-324.88C591.69,-353.05 612.58,-385.55 632.45,-416.48"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="630.26,-418.25 636.94,-423.47 634.97,-415.22 630.26,-418.25"/>
+</g>
+<!-- recipe_log&#45;&gt;recipes -->
+<g id="edge8" class="edge">
+<title>recipe_log&#45;&gt;recipes</title>
+<path fill="none" stroke="black" stroke-width="0.9" d="M451.46,-206.39C438.12,-198.85 424.11,-190.94 410.56,-183.29"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="411.87,-180.81 403.53,-179.31 409.12,-185.69 411.87,-180.81"/>
+</g>
+<!-- recipe_log&#45;&gt;meal_names -->
+<g id="edge9" class="edge">
+<title>recipe_log&#45;&gt;meal_names</title>
+<path fill="none" stroke="black" stroke-width="0.9" d="M593.84,-169.43C622.05,-138.18 653.43,-103.43 677.09,-77.22"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="679.34,-78.91 682.63,-71.09 675.19,-75.15 679.34,-78.91"/>
+</g>
+<!-- rda -->
+<g id="node12" class="node">
 <title>rda</title>
-<path fill="none" stroke="black" d="M437.69,-0.67C437.69,-0.67 557.69,-0.67 557.69,-0.67 563.69,-0.67 569.69,-6.67 569.69,-12.67 569.69,-12.67 569.69,-92.67 569.69,-92.67 569.69,-98.67 563.69,-104.67 557.69,-104.67 557.69,-104.67 437.69,-104.67 437.69,-104.67 431.69,-104.67 425.69,-98.67 425.69,-92.67 425.69,-92.67 425.69,-12.67 425.69,-12.67 425.69,-6.67 431.69,-0.67 437.69,-0.67"/>
-<text text-anchor="start" x="485.69" y="-84.27" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">rda</text>
-<polyline fill="none" stroke="black" points="425.69,-74.67 569.69,-74.67 "/>
-<text text-anchor="start" x="432.69" y="-61.07" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
-<text text-anchor="start" x="479.69" y="-61.07" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="432.69" y="-44.07" font-family="Helvetica,sans-Serif" font-size="12.00">nutr_id </text>
-<text text-anchor="start" x="478.69" y="-44.07" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
-<text text-anchor="start" x="432.69" y="-27.07" font-family="Helvetica,sans-Serif" font-size="12.00">rda </text>
-<text text-anchor="start" x="456.69" y="-27.07" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
-<text text-anchor="start" x="432.69" y="-10.07" font-family="Helvetica,sans-Serif" font-size="12.00">synced </text>
-<text text-anchor="start" x="478.69" y="-10.07" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<path fill="none" stroke="black" d="M742.02,-742.92C742.02,-742.92 862.02,-742.92 862.02,-742.92 868.02,-742.92 874.02,-748.92 874.02,-754.92 874.02,-754.92 874.02,-834.92 874.02,-834.92 874.02,-840.92 868.02,-846.92 862.02,-846.92 862.02,-846.92 742.02,-846.92 742.02,-846.92 736.02,-846.92 730.02,-840.92 730.02,-834.92 730.02,-834.92 730.02,-754.92 730.02,-754.92 730.02,-748.92 736.02,-742.92 742.02,-742.92"/>
+<text text-anchor="start" x="790.02" y="-826.52" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">rda</text>
+<polyline fill="none" stroke="black" points="730.02,-816.92 874.02,-816.92 "/>
+<text text-anchor="start" x="737.02" y="-803.32" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
+<text text-anchor="start" x="784.02" y="-803.32" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="737.02" y="-786.32" font-family="Helvetica,sans-Serif" font-size="12.00">nutr_id </text>
+<text text-anchor="start" x="783.02" y="-786.32" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="737.02" y="-769.32" font-family="Helvetica,sans-Serif" font-size="12.00">rda </text>
+<text text-anchor="start" x="761.02" y="-769.32" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="737.02" y="-752.32" font-family="Helvetica,sans-Serif" font-size="12.00">synced </text>
+<text text-anchor="start" x="783.02" y="-752.32" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
 </g>
 <!-- rda&#45;&gt;users -->
-<g id="edge10" class="edge">
+<g id="edge11" class="edge">
 <title>rda&#45;&gt;users</title>
-<path fill="none" stroke="black" stroke-width="0.9" d="M499.14,-104.71C501.05,-172.94 504.45,-294.71 507.02,-386.34"/>
-<polygon fill="black" stroke="black" stroke-width="0.9" points="504.22,-386.63 507.24,-394.55 509.82,-386.47 504.22,-386.63"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M783.33,-742.79C775.06,-719.72 764.93,-691.48 754.85,-663.37"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="757.49,-662.42 752.15,-655.83 752.21,-664.31 757.49,-662.42"/>
+</g>
+<!-- sync_data -->
+<g id="node13" class="node">
+<title>sync_data</title>
+<path fill="none" stroke="black" d="M213.24,-670.14C213.24,-670.14 333.24,-670.14 333.24,-670.14 339.24,-670.14 345.24,-676.14 345.24,-682.14 345.24,-682.14 345.24,-779.14 345.24,-779.14 345.24,-785.14 339.24,-791.14 333.24,-791.14 333.24,-791.14 213.24,-791.14 213.24,-791.14 207.24,-791.14 201.24,-785.14 201.24,-779.14 201.24,-779.14 201.24,-682.14 201.24,-682.14 201.24,-676.14 207.24,-670.14 213.24,-670.14"/>
+<text text-anchor="start" x="237.24" y="-770.74" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">sync_data</text>
+<polyline fill="none" stroke="black" points="201.24,-761.14 345.24,-761.14 "/>
+<text text-anchor="start" x="208.24" y="-747.04" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="229.24" y="-747.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="208.24" y="-730.04" font-family="Helvetica,sans-Serif" font-size="12.00">tablename </text>
+<text text-anchor="start" x="277.24" y="-730.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="208.24" y="-713.04" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="238.24" y="-713.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="208.24" y="-696.04" font-family="Helvetica,sans-Serif" font-size="12.00">constraint </text>
+<text text-anchor="start" x="272.24" y="-696.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="208.24" y="-679.04" font-family="Helvetica,sans-Serif" font-size="12.00">action </text>
+<text text-anchor="start" x="249.24" y="-679.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 </g>
 </svg>
index 8c69c02412d2ebfc7104a671b5ef833d566c4189..4f8c0602cc02c8b4fdd306f2038057610d706438 100644 (file)
@@ -1,23 +1,23 @@
-id,guid,user_id,date,meal_id,amount,food_id,food_msre_id
-1,365e2f316ea39c578a63ec0f59c0d0f0,1,2020-09-20,1,100,13047,
-2,71d5d8cbbc591d22cb210ae6323249a1,1,2020-09-20,1,28,1270,
-3,295f1cd568fc03b760ff9a3a985c4658,1,2020-09-21,1,55,9038,
-4,30bb19b8d57492fee6cb1ebbdc9196a,1,2020-09-21,1,20,11251,
-5,d2e64b1da42c2e12bd3dc9f029fb1bb5,1,2020-09-22,1,35,11529,
-6,b169e76aa7ccd833a3f7d0e1a5f6935b,1,2020-09-22,1,15,11282,
-7,2c53dca9604ea742c39184201d41eed4,1,2020-09-23,1,210,11828,
-8,edad78872ae5d7e2a444756a336dce40,1,2020-09-23,1,40,28313,
-9,c78bb27a7c756763d10d4bb7f860ba23,1,2020-09-24,1,100,9112,
-10,490ffdd0063fcfc79ce5f825a7f2d370,1,2020-09-24,2,140,20137,
-11,7fe9a33f24010f1738ddf73010041ced,1,2020-09-25,2,100,5062,
-12,a54ddeafde280fd76a0cbbd63b9539e7,1,2020-09-25,2,45,12136,
-13,6dfcfbbd5d0cb563343260d287cbdff5,1,2020-09-26,2,50,11821,
-14,4704b0288bf626799dc2c09cbb75f28,1,2020-09-26,2,15,44005,
-15,7053ec55502f3dccccf16d59c2a38873,1,2020-09-27,3,150,20545,
-16,8f7d5caef9dac0d7102a4d90ae9f36c8,1,2020-09-27,3,85,16146,
-17,79949cb0b9914d63892b89d91a4a4ad0,1,2020-09-28,3,40,1270,
-18,85a4ab5a6da9fa84285dece0f2c7fa2a,1,2020-09-28,3,60,9037,
-19,16f98e0382dece4799dd41325b292c70,1,2020-09-29,3,100,15076,
-20,bcab83a1676a3ac8f6aadd63dd032e06,1,2020-09-29,3,60,11090,
-21,44aa12a8695bfd84a513e24bb65896d9,1,2020-09-30,3,35,11938,
-22,252045bc8ba3f133d4006d82a467b053,1,2020-09-30,3,25,11282,
+id,guid,user_id,date,meal_id,grams,food_id
+1,365e2f316ea39c578a63ec0f59c0d0f0,1,2020-09-20,1,100,13047
+2,71d5d8cbbc591d22cb210ae6323249a1,1,2020-09-20,1,28,1270
+3,295f1cd568fc03b760ff9a3a985c4658,1,2020-09-20,1,55,9038
+4,30bb19b8d57492fee6cb1ebbdc9196a,1,2020-09-20,1,20,11251
+5,d2e64b1da42c2e12bd3dc9f029fb1bb5,1,2020-09-20,1,35,11529
+6,b169e76aa7ccd833a3f7d0e1a5f6935b,1,2020-09-20,1,15,11282
+7,2c53dca9604ea742c39184201d41eed4,1,2020-09-20,1,210,11828
+8,edad78872ae5d7e2a444756a336dce40,1,2020-09-20,1,40,28313
+9,c78bb27a7c756763d10d4bb7f860ba23,1,2020-09-20,1,100,9112
+10,490ffdd0063fcfc79ce5f825a7f2d370,1,2020-09-20,2,140,20137
+11,7fe9a33f24010f1738ddf73010041ced,1,2020-09-20,2,100,5062
+12,a54ddeafde280fd76a0cbbd63b9539e7,1,2020-09-20,2,45,12136
+13,6dfcfbbd5d0cb563343260d287cbdff5,1,2020-09-20,2,50,11821
+14,4704b0288bf626799dc2c09cbb75f28,1,2020-09-20,2,15,44005
+15,7053ec55502f3dccccf16d59c2a38873,1,2020-09-20,3,150,20545
+16,8f7d5caef9dac0d7102a4d90ae9f36c8,1,2020-09-20,3,85,16146
+17,79949cb0b9914d63892b89d91a4a4ad0,1,2020-09-20,3,40,1270
+18,85a4ab5a6da9fa84285dece0f2c7fa2a,1,2020-09-20,3,60,9037
+19,16f98e0382dece4799dd41325b292c70,1,2020-09-20,3,100,15076
+20,bcab83a1676a3ac8f6aadd63dd032e06,1,2020-09-20,3,60,11090
+21,44aa12a8695bfd84a513e24bb65896d9,1,2020-09-20,3,35,11938
+22,252045bc8ba3f133d4006d82a467b053,1,2020-09-20,3,25,11282
index 2f62aa2b23bf4979fbea872b3c762f6e952547fc..c1aaddacbbd997b6e3187ee085ea777f4d733e9c 100644 (file)
@@ -1,4 +1,4 @@
-recipe_id,food_id,amount,notes
+recipe_id,food_id,grams,notes
 1,20045,180,white rice
 1,16042,25,pinto beans
 1,11282,45,onions
diff --git a/sql/export.sh b/sql/export.sh
new file mode 100755 (executable)
index 0000000..627d8d8
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash -e
+
+cd "$(dirname "$0")"
+
+table_cmd="sqlite3 nt.sqlite '.tables'"
+tables=`sqlite3 nt.sqlite '.tables'`
+
+for t in $tables
+do
+    export_cmd="SELECT * FROM $t"
+    echo $export_cmd
+    export_cmd="sqlite3 -csv nt.sqlite "\"$export_cmd\"""
+    bash -exec "$export_cmd" > "data/$t.csv"
+done
index 1e21bb81ffb4cfc1dd4aff8fbc36a663e8471f47..f02128891c6973b13c5bfef8c5ef2df54fa6ab4a 100644 (file)
@@ -121,11 +121,9 @@ CREATE TABLE food_log (
   user_id int,
   date date DEFAULT CURRENT_DATE,
   meal_id int,
-  amount real NOT NULL, -- grams, if `food_msre_id` IS NULL
+  grams real NOT NULL,
   -- TODO: enforce FK constraint across two DBs?
-
   food_id int,
-  food_msre_id int,
   FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE,
   FOREIGN KEY (meal_id) REFERENCES meal_names (id) ON UPDATE CASCADE
 );