add functions and bio data
authorgamesguru <mathmuncher11@gmail.com>
Tue, 29 Sep 2020 13:07:25 +0000 (09:07 -0400)
committergamesguru <mathmuncher11@gmail.com>
Tue, 29 Sep 2020 14:39:57 +0000 (10:39 -0400)
docs/nt.svg
sql/data/bio_log_entry.csv [new file with mode: 0644]
sql/data/biometric_log.csv [new file with mode: 0644]
sql/functions.sql [new file with mode: 0644]
sql/import.sql
sql/tables.sql

index 992660a8688cac97880ffaed44ef857f83495d4b..ae3aa77a8f3222b257666f90599cfde2e9dd8c25 100644 (file)
 <!-- Generated by graphviz version 2.43.0 (0)
  -->
 <!-- Title: undefined Pages: 1 -->
-<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)">
+<svg width="787pt" height="1516pt"
+ viewBox="0.00 0.00 786.60 1515.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 1465.8)">
 <title>undefined</title>
-<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>
+<polygon fill="white" stroke="transparent" points="-28.8,49.8 -28.8,-1465.8 757.8,-1465.8 757.8,49.8 -28.8,49.8"/>
+<text text-anchor="start" x="336" 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="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>
+<path fill="none" stroke="black" d="M597.24,-715.64C597.24,-715.64 717.24,-715.64 717.24,-715.64 723.24,-715.64 729.24,-721.64 729.24,-727.64 729.24,-727.64 729.24,-807.64 729.24,-807.64 729.24,-813.64 723.24,-819.64 717.24,-819.64 717.24,-819.64 597.24,-819.64 597.24,-819.64 591.24,-819.64 585.24,-813.64 585.24,-807.64 585.24,-807.64 585.24,-727.64 585.24,-727.64 585.24,-721.64 591.24,-715.64 597.24,-715.64"/>
+<text text-anchor="start" x="630.24" y="-799.24" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">version</text>
+<polyline fill="none" stroke="black" points="585.24,-789.64 729.24,-789.64 "/>
+<text text-anchor="start" x="592.24" y="-776.04" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="613.24" y="-776.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="592.24" y="-759.04" font-family="Helvetica,sans-Serif" font-size="12.00">version </text>
+<text text-anchor="start" x="640.24" y="-759.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="592.24" y="-742.04" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
+<text text-anchor="start" x="642.24" y="-742.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
+<text text-anchor="start" x="592.24" y="-725.04" font-family="Helvetica,sans-Serif" font-size="12.00">notes </text>
+<text text-anchor="start" x="629.24" y="-725.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="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>
+<path fill="none" stroke="black" d="M12.26,-812.54C12.26,-812.54 132.26,-812.54 132.26,-812.54 138.26,-812.54 144.26,-818.54 144.26,-824.54 144.26,-824.54 144.26,-870.54 144.26,-870.54 144.26,-876.54 138.26,-882.54 132.26,-882.54 132.26,-882.54 12.26,-882.54 12.26,-882.54 6.26,-882.54 0.26,-876.54 0.26,-870.54 0.26,-870.54 0.26,-824.54 0.26,-824.54 0.26,-818.54 6.26,-812.54 12.26,-812.54"/>
+<text text-anchor="start" x="41.26" y="-862.14" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">bmr_eqs</text>
+<polyline fill="none" stroke="black" points="0.26,-852.54 144.26,-852.54 "/>
+<text text-anchor="start" x="7.26" y="-838.94" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="28.26" y="-838.94" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="7.26" y="-821.94" font-family="Helvetica,sans-Serif" font-size="12.00">bmr_eq </text>
+<text text-anchor="start" x="57.26" y="-821.94" 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="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>
+<path fill="none" stroke="black" d="M592.22,-535.74C592.22,-535.74 712.22,-535.74 712.22,-535.74 718.22,-535.74 724.22,-541.74 724.22,-547.74 724.22,-547.74 724.22,-593.74 724.22,-593.74 724.22,-599.74 718.22,-605.74 712.22,-605.74 712.22,-605.74 592.22,-605.74 592.22,-605.74 586.22,-605.74 580.22,-599.74 580.22,-593.74 580.22,-593.74 580.22,-547.74 580.22,-547.74 580.22,-541.74 586.22,-535.74 592.22,-535.74"/>
+<text text-anchor="start" x="628.22" y="-585.34" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">bf_eqs</text>
+<polyline fill="none" stroke="black" points="580.22,-575.74 724.22,-575.74 "/>
+<text text-anchor="start" x="587.22" y="-562.14" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="608.22" y="-562.14" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="587.22" y="-545.14" font-family="Helvetica,sans-Serif" font-size="12.00">bf_eq </text>
+<text text-anchor="start" x="624.22" y="-545.14" 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="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>
+<path fill="none" stroke="black" d="M279.12,-619.16C279.12,-619.16 399.12,-619.16 399.12,-619.16 405.12,-619.16 411.12,-625.16 411.12,-631.16 411.12,-631.16 411.12,-847.16 411.12,-847.16 411.12,-853.16 405.12,-859.16 399.12,-859.16 399.12,-859.16 279.12,-859.16 279.12,-859.16 273.12,-859.16 267.12,-853.16 267.12,-847.16 267.12,-847.16 267.12,-631.16 267.12,-631.16 267.12,-625.16 273.12,-619.16 279.12,-619.16"/>
+<text text-anchor="start" x="319.12" y="-838.76" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">users</text>
+<polyline fill="none" stroke="black" points="267.12,-829.16 411.12,-829.16 "/>
+<text text-anchor="start" x="274.12" y="-815.56" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="295.12" y="-815.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="274.12" y="-798.56" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
+<text text-anchor="start" x="313.12" y="-798.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="274.12" y="-781.56" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="304.12" y="-781.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="274.12" y="-764.56" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
+<text text-anchor="start" x="324.12" y="-764.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="274.12" y="-747.56" font-family="Helvetica,sans-Serif" font-size="12.00">eula </text>
+<text text-anchor="start" x="304.12" y="-747.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="274.12" y="-730.56" font-family="Helvetica,sans-Serif" font-size="12.00">gender </text>
+<text text-anchor="start" x="321.12" y="-730.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="274.12" y="-713.56" font-family="Helvetica,sans-Serif" font-size="12.00">dob </text>
+<text text-anchor="start" x="301.12" y="-713.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
+<text text-anchor="start" x="274.12" y="-696.56" font-family="Helvetica,sans-Serif" font-size="12.00">act_lvl </text>
+<text text-anchor="start" x="316.12" y="-696.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="274.12" y="-679.56" font-family="Helvetica,sans-Serif" font-size="12.00">goal_wt </text>
+<text text-anchor="start" x="324.12" y="-679.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="274.12" y="-662.56" font-family="Helvetica,sans-Serif" font-size="12.00">goal_bf </text>
+<text text-anchor="start" x="322.12" y="-662.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="274.12" y="-645.56" font-family="Helvetica,sans-Serif" font-size="12.00">bmr_id </text>
+<text text-anchor="start" x="320.12" y="-645.56" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="274.12" y="-628.56" font-family="Helvetica,sans-Serif" font-size="12.00">bf_id </text>
+<text text-anchor="start" x="307.12" y="-628.56" 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="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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M266.91,-768.49C231.46,-782.89 188.64,-800.27 152.21,-815.07"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="150.89,-812.58 144.53,-818.19 153,-817.77 150.89,-812.58"/>
 </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="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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M411.35,-700.31C461.87,-673.13 529.09,-636.97 579.68,-609.76"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="581.3,-612.07 587.02,-605.81 578.64,-607.13 581.3,-612.07"/>
 </g>
 <!-- biometrics -->
 <g id="node5" class="node">
 <title>biometrics</title>
-<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>
+<path fill="none" stroke="black" d="M357.21,-1332.17C357.21,-1332.17 477.21,-1332.17 477.21,-1332.17 483.21,-1332.17 489.21,-1338.17 489.21,-1344.17 489.21,-1344.17 489.21,-1424.17 489.21,-1424.17 489.21,-1430.17 483.21,-1436.17 477.21,-1436.17 477.21,-1436.17 357.21,-1436.17 357.21,-1436.17 351.21,-1436.17 345.21,-1430.17 345.21,-1424.17 345.21,-1424.17 345.21,-1344.17 345.21,-1344.17 345.21,-1338.17 351.21,-1332.17 357.21,-1332.17"/>
+<text text-anchor="start" x="378.21" y="-1415.77" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">biometrics</text>
+<polyline fill="none" stroke="black" points="345.21,-1406.17 489.21,-1406.17 "/>
+<text text-anchor="start" x="352.21" y="-1392.57" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="373.21" y="-1392.57" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="352.21" y="-1375.57" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
+<text text-anchor="start" x="391.21" y="-1375.57" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="352.21" y="-1358.57" font-family="Helvetica,sans-Serif" font-size="12.00">unit </text>
+<text text-anchor="start" x="379.21" y="-1358.57" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="352.21" y="-1341.57" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
+<text text-anchor="start" x="402.21" y="-1341.57" 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="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>
+<path fill="none" stroke="black" d="M539.76,-886.43C539.76,-886.43 659.76,-886.43 659.76,-886.43 665.76,-886.43 671.76,-892.43 671.76,-898.43 671.76,-898.43 671.76,-995.43 671.76,-995.43 671.76,-1001.43 665.76,-1007.43 659.76,-1007.43 659.76,-1007.43 539.76,-1007.43 539.76,-1007.43 533.76,-1007.43 527.76,-1001.43 527.76,-995.43 527.76,-995.43 527.76,-898.43 527.76,-898.43 527.76,-892.43 533.76,-886.43 539.76,-886.43"/>
+<text text-anchor="start" x="549.76" y="-987.03" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">biometric_log</text>
+<polyline fill="none" stroke="black" points="527.76,-977.43 671.76,-977.43 "/>
+<text text-anchor="start" x="534.76" y="-963.33" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="555.76" y="-963.33" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="534.76" y="-946.33" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="564.76" y="-946.33" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="534.76" y="-929.33" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
+<text text-anchor="start" x="581.76" y="-929.33" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="534.76" y="-912.33" font-family="Helvetica,sans-Serif" font-size="12.00">date </text>
+<text text-anchor="start" x="565.76" y="-912.33" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="534.76" y="-895.33" font-family="Helvetica,sans-Serif" font-size="12.00">notes </text>
+<text text-anchor="start" x="571.76" y="-895.33" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- biometric_log&#45;&gt;users -->
-<g id="edge4" class="edge">
+<g id="edge3" class="edge">
 <title>biometric_log&#45;&gt;users</title>
-<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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M527.51,-889.33C493.47,-862.2 452.79,-829.77 417.95,-802"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="419.52,-799.67 411.52,-796.87 416.03,-804.05 419.52,-799.67"/>
 </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="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"/>
+<!-- bio_log_entry -->
+<g id="node7" class="node">
+<title>bio_log_entry</title>
+<path fill="none" stroke="black" d="M553.35,-1148.21C553.35,-1148.21 673.35,-1148.21 673.35,-1148.21 679.35,-1148.21 685.35,-1154.21 685.35,-1160.21 685.35,-1160.21 685.35,-1223.21 685.35,-1223.21 685.35,-1229.21 679.35,-1235.21 673.35,-1235.21 673.35,-1235.21 553.35,-1235.21 553.35,-1235.21 547.35,-1235.21 541.35,-1229.21 541.35,-1223.21 541.35,-1223.21 541.35,-1160.21 541.35,-1160.21 541.35,-1154.21 547.35,-1148.21 553.35,-1148.21"/>
+<text text-anchor="start" x="564.35" y="-1214.81" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">bio_log_entry</text>
+<polyline fill="none" stroke="black" points="541.35,-1205.21 685.35,-1205.21 "/>
+<text text-anchor="start" x="548.35" y="-1191.11" font-family="Helvetica,sans-Serif" font-size="12.00">log_id* </text>
+<text text-anchor="start" x="593.35" y="-1191.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="548.35" y="-1174.11" font-family="Helvetica,sans-Serif" font-size="12.00">biometric_id* </text>
+<text text-anchor="start" x="632.35" y="-1174.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="548.35" y="-1157.11" font-family="Helvetica,sans-Serif" font-size="12.00">value </text>
+<text text-anchor="start" x="585.35" y="-1157.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+</g>
+<!-- bio_log_entry&#45;&gt;biometrics -->
+<g id="edge4" class="edge">
+<title>bio_log_entry&#45;&gt;biometrics</title>
+<path fill="none" stroke="black" stroke-width="0.9" d="M568.84,-1235.39C541.4,-1262.31 505.88,-1297.16 476.12,-1326.36"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="474,-1324.52 470.25,-1332.12 477.92,-1328.52 474,-1324.52"/>
+</g>
+<!-- bio_log_entry&#45;&gt;biometric_log -->
+<g id="edge5" class="edge">
+<title>bio_log_entry&#45;&gt;biometric_log</title>
+<path fill="none" stroke="black" stroke-width="0.9" d="M610.92,-1147.95C608.88,-1111.26 605.94,-1058.22 603.59,-1015.84"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="606.38,-1015.61 603.14,-1007.78 600.79,-1015.92 606.38,-1015.61"/>
 </g>
 <!-- recipes -->
-<g id="node7" class="node">
+<g id="node8" class="node">
 <title>recipes</title>
-<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>
+<path fill="none" stroke="black" d="M367.25,-137.08C367.25,-137.08 487.25,-137.08 487.25,-137.08 493.25,-137.08 499.25,-143.08 499.25,-149.08 499.25,-149.08 499.25,-229.08 499.25,-229.08 499.25,-235.08 493.25,-241.08 487.25,-241.08 487.25,-241.08 367.25,-241.08 367.25,-241.08 361.25,-241.08 355.25,-235.08 355.25,-229.08 355.25,-229.08 355.25,-149.08 355.25,-149.08 355.25,-143.08 361.25,-137.08 367.25,-137.08"/>
+<text text-anchor="start" x="400.25" y="-220.68" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">recipes</text>
+<polyline fill="none" stroke="black" points="355.25,-211.08 499.25,-211.08 "/>
+<text text-anchor="start" x="362.25" y="-197.48" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="383.25" y="-197.48" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="362.25" y="-180.48" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="392.25" y="-180.48" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="362.25" y="-163.48" font-family="Helvetica,sans-Serif" font-size="12.00">created </text>
+<text text-anchor="start" x="412.25" y="-163.48" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="362.25" y="-146.48" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
+<text text-anchor="start" x="401.25" y="-146.48" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- recipe_dat -->
-<g id="node8" class="node">
+<g id="node9" class="node">
 <title>recipe_dat</title>
-<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>
+<path fill="none" stroke="black" d="M520.17,-0.07C520.17,-0.07 640.17,-0.07 640.17,-0.07 646.17,-0.07 652.17,-6.07 652.17,-12.07 652.17,-12.07 652.17,-92.07 652.17,-92.07 652.17,-98.07 646.17,-104.07 640.17,-104.07 640.17,-104.07 520.17,-104.07 520.17,-104.07 514.17,-104.07 508.17,-98.07 508.17,-92.07 508.17,-92.07 508.17,-12.07 508.17,-12.07 508.17,-6.07 514.17,-0.07 520.17,-0.07"/>
+<text text-anchor="start" x="542.17" y="-83.67" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">recipe_dat</text>
+<polyline fill="none" stroke="black" points="508.17,-74.07 652.17,-74.07 "/>
+<text text-anchor="start" x="515.17" y="-60.47" font-family="Helvetica,sans-Serif" font-size="12.00">recipe_id* </text>
+<text text-anchor="start" x="579.17" y="-60.47" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="515.17" y="-43.47" font-family="Helvetica,sans-Serif" font-size="12.00">food_id* </text>
+<text text-anchor="start" x="569.17" y="-43.47" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="515.17" y="-26.47" font-family="Helvetica,sans-Serif" font-size="12.00">grams </text>
+<text text-anchor="start" x="558.17" y="-26.47" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="515.17" y="-9.47" font-family="Helvetica,sans-Serif" font-size="12.00">notes </text>
+<text text-anchor="start" x="552.17" y="-9.47" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- recipe_dat&#45;&gt;recipes -->
-<g id="edge5" class="edge">
+<g id="edge6" class="edge">
 <title>recipe_dat&#45;&gt;recipes</title>
-<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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M521.92,-104.26C511.99,-113.15 501.63,-122.43 491.56,-131.46"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="489.43,-129.61 485.34,-137.04 493.16,-133.78 489.43,-129.61"/>
 </g>
 <!-- meal_names -->
-<g id="node9" class="node">
+<g id="node10" class="node">
 <title>meal_names</title>
-<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>
+<path fill="none" stroke="black" d="M15.94,-277.55C15.94,-277.55 135.94,-277.55 135.94,-277.55 141.94,-277.55 147.94,-283.55 147.94,-289.55 147.94,-289.55 147.94,-335.55 147.94,-335.55 147.94,-341.55 141.94,-347.55 135.94,-347.55 135.94,-347.55 15.94,-347.55 15.94,-347.55 9.94,-347.55 3.94,-341.55 3.94,-335.55 3.94,-335.55 3.94,-289.55 3.94,-289.55 3.94,-283.55 9.94,-277.55 15.94,-277.55"/>
+<text text-anchor="start" x="30.94" y="-327.15" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">meal_names</text>
+<polyline fill="none" stroke="black" points="3.94,-317.55 147.94,-317.55 "/>
+<text text-anchor="start" x="10.94" y="-303.95" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="31.94" y="-303.95" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="10.94" y="-286.95" font-family="Helvetica,sans-Serif" font-size="12.00">name </text>
+<text text-anchor="start" x="49.94" y="-286.95" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 <!-- food_log -->
-<g id="node10" class="node">
+<g id="node11" class="node">
 <title>food_log</title>
-<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>
+<path fill="none" stroke="black" d="M31.32,-459.08C31.32,-459.08 151.32,-459.08 151.32,-459.08 157.32,-459.08 163.32,-465.08 163.32,-471.08 163.32,-471.08 163.32,-602.08 163.32,-602.08 163.32,-608.08 157.32,-614.08 151.32,-614.08 151.32,-614.08 31.32,-614.08 31.32,-614.08 25.32,-614.08 19.32,-608.08 19.32,-602.08 19.32,-602.08 19.32,-471.08 19.32,-471.08 19.32,-465.08 25.32,-459.08 31.32,-459.08"/>
+<text text-anchor="start" x="60.32" y="-593.68" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">food_log</text>
+<polyline fill="none" stroke="black" points="19.32,-584.08 163.32,-584.08 "/>
+<text text-anchor="start" x="26.32" y="-569.98" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="47.32" y="-569.98" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="26.32" y="-552.98" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="56.32" y="-552.98" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="26.32" y="-535.98" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
+<text text-anchor="start" x="73.32" y="-535.98" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="26.32" y="-518.98" font-family="Helvetica,sans-Serif" font-size="12.00">date </text>
+<text text-anchor="start" x="57.32" y="-518.98" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
+<text text-anchor="start" x="26.32" y="-501.98" font-family="Helvetica,sans-Serif" font-size="12.00">meal_id </text>
+<text text-anchor="start" x="77.32" y="-501.98" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="26.32" y="-484.98" font-family="Helvetica,sans-Serif" font-size="12.00">grams </text>
+<text text-anchor="start" x="69.32" y="-484.98" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="26.32" y="-467.98" font-family="Helvetica,sans-Serif" font-size="12.00">food_id </text>
+<text text-anchor="start" x="74.32" y="-467.98" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
 </g>
 <!-- food_log&#45;&gt;users -->
-<g id="edge7" class="edge">
+<g id="edge8" class="edge">
 <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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M163.33,-595.45C193.74,-620.31 229.25,-649.34 260.37,-674.78"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="258.97,-677.25 266.93,-680.15 262.51,-672.92 258.97,-677.25"/>
 </g>
 <!-- food_log&#45;&gt;meal_names -->
-<g id="edge6" class="edge">
+<g id="edge7" class="edge">
 <title>food_log&#45;&gt;meal_names</title>
-<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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M85.98,-458.85C83.62,-424.46 80.93,-385.3 78.93,-356.15"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="81.7,-355.61 78.36,-347.82 76.12,-356 81.7,-355.61"/>
 </g>
 <!-- recipe_log -->
-<g id="node11" class="node">
+<g id="node12" 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>
+<path fill="none" stroke="black" d="M246.24,-347.65C246.24,-347.65 366.24,-347.65 366.24,-347.65 372.24,-347.65 378.24,-353.65 378.24,-359.65 378.24,-359.65 378.24,-490.65 378.24,-490.65 378.24,-496.65 372.24,-502.65 366.24,-502.65 366.24,-502.65 246.24,-502.65 246.24,-502.65 240.24,-502.65 234.24,-496.65 234.24,-490.65 234.24,-490.65 234.24,-359.65 234.24,-359.65 234.24,-353.65 240.24,-347.65 246.24,-347.65"/>
+<text text-anchor="start" x="268.24" y="-482.25" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">recipe_log</text>
+<polyline fill="none" stroke="black" points="234.24,-472.65 378.24,-472.65 "/>
+<text text-anchor="start" x="241.24" y="-458.55" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="262.24" y="-458.55" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="241.24" y="-441.55" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="271.24" y="-441.55" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="241.24" y="-424.55" font-family="Helvetica,sans-Serif" font-size="12.00">user_id </text>
+<text text-anchor="start" x="288.24" y="-424.55" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="241.24" y="-407.55" font-family="Helvetica,sans-Serif" font-size="12.00">date </text>
+<text text-anchor="start" x="272.24" y="-407.55" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">date</text>
+<text text-anchor="start" x="241.24" y="-390.55" font-family="Helvetica,sans-Serif" font-size="12.00">meal_id </text>
+<text text-anchor="start" x="292.24" y="-390.55" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="241.24" y="-373.55" font-family="Helvetica,sans-Serif" font-size="12.00">grams </text>
+<text text-anchor="start" x="284.24" y="-373.55" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="241.24" y="-356.55" font-family="Helvetica,sans-Serif" font-size="12.00">recipe_id </text>
+<text text-anchor="start" x="299.24" y="-356.55" 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">
+<g id="edge11" 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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M314.37,-502.77C317.78,-535.36 321.84,-574.13 325.68,-610.76"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="322.92,-611.37 326.54,-619.03 328.49,-610.79 322.92,-611.37"/>
 </g>
 <!-- recipe_log&#45;&gt;recipes -->
-<g id="edge8" class="edge">
+<g id="edge9" 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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M346.03,-347.52C362.48,-315.44 381.25,-278.82 396.6,-248.88"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="399.27,-249.81 400.42,-241.41 394.28,-247.26 399.27,-249.81"/>
 </g>
 <!-- recipe_log&#45;&gt;meal_names -->
-<g id="edge9" class="edge">
+<g id="edge10" 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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M234,-389.83C209.03,-377.62 180.91,-363.87 155.39,-351.4"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="156.34,-348.74 147.92,-347.74 153.88,-353.77 156.34,-348.74"/>
 </g>
 <!-- rda -->
-<g id="node12" class="node">
+<g id="node13" class="node">
 <title>rda</title>
-<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>
+<path fill="none" stroke="black" d="M252.93,-960.97C252.93,-960.97 372.93,-960.97 372.93,-960.97 378.93,-960.97 384.93,-966.97 384.93,-972.97 384.93,-972.97 384.93,-1052.97 384.93,-1052.97 384.93,-1058.97 378.93,-1064.97 372.93,-1064.97 372.93,-1064.97 252.93,-1064.97 252.93,-1064.97 246.93,-1064.97 240.93,-1058.97 240.93,-1052.97 240.93,-1052.97 240.93,-972.97 240.93,-972.97 240.93,-966.97 246.93,-960.97 252.93,-960.97"/>
+<text text-anchor="start" x="300.93" y="-1044.57" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">rda</text>
+<polyline fill="none" stroke="black" points="240.93,-1034.97 384.93,-1034.97 "/>
+<text text-anchor="start" x="247.93" y="-1021.37" font-family="Helvetica,sans-Serif" font-size="12.00">user_id* </text>
+<text text-anchor="start" x="300.93" y="-1021.37" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="247.93" y="-1004.37" font-family="Helvetica,sans-Serif" font-size="12.00">nutr_id* </text>
+<text text-anchor="start" x="299.93" y="-1004.37" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
+<text text-anchor="start" x="247.93" y="-987.37" font-family="Helvetica,sans-Serif" font-size="12.00">rda </text>
+<text text-anchor="start" x="271.93" y="-987.37" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">real</text>
+<text text-anchor="start" x="247.93" y="-970.37" font-family="Helvetica,sans-Serif" font-size="12.00">synced </text>
+<text text-anchor="start" x="293.93" y="-970.37" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">int</text>
 </g>
 <!-- rda&#45;&gt;users -->
-<g id="edge11" class="edge">
+<g id="edge12" class="edge">
 <title>rda&#45;&gt;users</title>
-<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"/>
+<path fill="none" stroke="black" stroke-width="0.9" d="M317.92,-960.82C320.46,-934.22 323.68,-900.57 326.84,-867.58"/>
+<polygon fill="black" stroke="black" stroke-width="0.9" points="329.66,-867.45 327.64,-859.22 324.09,-866.91 329.66,-867.45"/>
 </g>
 <!-- sync_data -->
-<g id="node13" class="node">
+<g id="node14" 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>
+<path fill="none" stroke="black" d="M467.24,-390.14C467.24,-390.14 587.24,-390.14 587.24,-390.14 593.24,-390.14 599.24,-396.14 599.24,-402.14 599.24,-402.14 599.24,-499.14 599.24,-499.14 599.24,-505.14 593.24,-511.14 587.24,-511.14 587.24,-511.14 467.24,-511.14 467.24,-511.14 461.24,-511.14 455.24,-505.14 455.24,-499.14 455.24,-499.14 455.24,-402.14 455.24,-402.14 455.24,-396.14 461.24,-390.14 467.24,-390.14"/>
+<text text-anchor="start" x="491.24" y="-490.74" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">sync_data</text>
+<polyline fill="none" stroke="black" points="455.24,-481.14 599.24,-481.14 "/>
+<text text-anchor="start" x="462.24" y="-467.04" font-family="Helvetica,sans-Serif" font-size="12.00">id* </text>
+<text text-anchor="start" x="483.24" y="-467.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">integer</text>
+<text text-anchor="start" x="462.24" y="-450.04" font-family="Helvetica,sans-Serif" font-size="12.00">tablename </text>
+<text text-anchor="start" x="531.24" y="-450.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="462.24" y="-433.04" font-family="Helvetica,sans-Serif" font-size="12.00">guid </text>
+<text text-anchor="start" x="492.24" y="-433.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="462.24" y="-416.04" font-family="Helvetica,sans-Serif" font-size="12.00">constraint </text>
+<text text-anchor="start" x="526.24" y="-416.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
+<text text-anchor="start" x="462.24" y="-399.04" font-family="Helvetica,sans-Serif" font-size="12.00">action </text>
+<text text-anchor="start" x="503.24" y="-399.04" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">text</text>
 </g>
 </g>
 </svg>
diff --git a/sql/data/bio_log_entry.csv b/sql/data/bio_log_entry.csv
new file mode 100644 (file)
index 0000000..d488584
--- /dev/null
@@ -0,0 +1,123 @@
+log_id,biometric_id,value
+1,22,61
+1,23,100
+1,24,54
+2,22,68
+2,23,93
+2,24,54
+3,22,62
+3,23,103
+3,24,50
+4,22,66
+4,23,99
+4,24,58
+5,22,82
+5,23,115
+5,24,63
+6,22,0
+6,23,104
+6,24,59
+7,22,70
+7,23,108
+7,24,63
+8,22,59
+8,23,112
+8,24,61
+9,22,62
+9,23,108
+9,24,65
+10,2,67
+10,5,
+10,6,
+10,7,
+10,8,
+10,9,
+10,10,
+10,11,
+10,12,
+10,13,
+10,14,
+10,15,
+10,16,
+10,17,
+10,18,
+10,19,
+10,20,
+11,22,53
+11,23,91
+11,24,60
+12,22,56
+12,23,101
+12,24,63
+13,22,64
+13,23,105
+13,24,62
+14,2,8.71
+14,5,
+14,6,
+14,9,
+14,10,
+14,12,
+15,2,74
+15,5,
+15,6,
+15,7,
+15,8,
+15,9,
+15,10,
+15,11,
+15,12,
+15,13,
+15,14,
+15,15,
+15,16,
+15,17,
+15,18,
+15,19,
+15,20,
+16,22,59
+16,23,103
+16,24,63
+17,22,53
+17,23,107
+17,24,66
+18,2,73
+18,14,18
+18,15,26
+18,16,15
+19,2,7.26
+20,22,61
+20,23,103
+20,24,65
+21,22,97
+21,23,110
+21,24,71
+22,22,62
+22,23,106
+22,24,68
+23,22,59
+23,23,110
+23,24,66
+24,22,59
+24,23,92
+24,24,58
+25,2,70
+26,2,65.4
+27,2,71
+28,2,67.6
+29,2,66
+30,2,67.2
+31,22,58
+31,23,102
+31,24,61
+32,22,83
+32,23,113
+32,24,64
+33,22,78
+33,23,105
+33,24,70
+34,2,69.5
+35,2,68.4
+36,22,66
+36,23,103
+36,24,63
diff --git a/sql/data/biometric_log.csv b/sql/data/biometric_log.csv
new file mode 100644 (file)
index 0000000..c1c0066
--- /dev/null
@@ -0,0 +1,37 @@
+id,guid,user_id,date,notes
+1,7417256ddb67b9094955de0d653e4b91,1,Sun 28 Jun 2020 02:07:01 PM EDT,exercise
+2,b6dc44db43f823a96bf14d378c4a6e10,2,Sun 28 Jun 2020 02:07:01 PM EDT,exercise
+3,52614b2f5118caa7e1c33f5306ec7eee,1,Sun 28 Jun 2020 02:38:20 PM EDT,
+4,ad4761f8458430bcf894919ffa0a60c8,2,Sun 28 Jun 2020 02:38:20 PM EDT,
+5,ddeda6b7aa0990902c0ff7ca8868c298,1,Sun 28 Jun 2020 10:05:26 PM EDT,exercise
+6,a8093d02eab44586e997b1c6f06024a5,2,Thu 02 Jul 2020 12:12:54 PM EDT,doctor's office
+7,3b621d8701bc0662d8a99c8e255ae2df,1,Sat 04 Jul 2020 03:50:13 PM EDT,
+8,4ff118cdb2f150c6dcaf63ea822133ee,2,Sat 04 Jul 2020 03:54:27 PM EDT,
+9,b12d98910582378fd0bfe513db27dba2,2,Sun 05 Jul 2020 01:30:44 PM EDT,no THC
+10,384729fed3c44775b5a6b83d9df441c1,1,Mon 06 Jul 2020 06:54:49 AM EDT,
+11,a8e6660500e975e6974dc5e5b409674e,2,Sun 12 Jul 2020 12:29:11 PM EDT,THC
+12,89d85a4c81b19ccc5b956574675e303b,2,Sun 12 Jul 2020 02:44:25 PM EDT,THC
+13,64f6ac68c4406082c2bd82f868b4e6ad,1,Sun 12 Jul 2020 02:44:25 PM EDT,THC
+14,d84f359570164f6f634c1f1ee428bf3f,3,Mon 13 Jul 2020 03:30:46 PM EDT,
+15,e43c46b7905f0f43a93a5a32caaf1350,2,Fri 17 Jul 2020 02:02:12 PM EDT,
+16,809ed86cf5f9ca733de44bd4dcafaa34,2,Fri 17 Jul 2020 03:14:37 PM EDT,THC
+17,0c025c05a37fa891ac922990b915008a,1,Fri 17 Jul 2020 03:14:37 PM EDT,
+18,4b7d0b88acd2b28555529185645c022e,2,Sat 08 Aug 2020 01:53:25 PM EDT,
+19,da611fdf349a36fbfabdc39f0b5dd511,3,Thu 27 Aug 2020 12:44:37 PM EDT,
+20,adc9cebc6ce0fe5caba725a20eaf3cf7,2,Fri 28 Aug 2020 03:40:56 PM EDT,
+21,42c2437c8a7d8c6c9df58b874b188bba,1,Fri 28 Aug 2020 03:40:56 PM EDT,1st dabs/2 weeks
+22,7bde0797bc4349091aa0c7c72e09abd2,2,Sun 06 Sep 2020 11:49:47 AM EDT,
+23,b4b5b2a3c5185f787d428db4ae9d4884,1,Sun 06 Sep 2020 11:53:21 AM EDT,
+24,c04eefe3c4c6e167d7bba4bb77d11f60,2,Sat 12 Sep 2020 12:15:53 PM EDT,
+25,e866e51372616e77d110889513ab79e8,2,Sun 06 Sep 2020,
+26,22e182dab0267ceecf537f10d76ccc7f,1,Sun 06 Sep 2020,
+27,2881dc500b6f205b45da19fd60e6464b,2,Sat 12 Sep 2020,
+28,360481648b356ac00ec2227805a02a5b,1,Sat 12 Sep 2020,
+29,f3bf14d7924cd164be8e3cbc56aa795d,1,Sun 13 Sep 2020,
+30,616bca3f62976021cc3b77e91a32de3b,1,Mon 14 Sep 2020,
+31,60a75a93acb0cf77e9f2fe1a05e4d19d,1,Fri 18 Sep 2020 09:04:38 PM EDT,exercise
+32,f4cf78ea8e2c7a03892e4b0268481b59,2,Thu 24 Sep 2020 05:05:51 PM EDT,illness
+33,63239cac4d86f57a69cf9a9c7799a13c,1,Thu 24 Sep 2020 05:05:51 PM EDT,
+34,0ebe7d5f9214f2e62c2952696caaadd9,2,Thu 24 Sep 2020,
+35,67e1a2d244afb9924d1999d792264109,2,Sat 26 Sep 2020,
+36,6f61f3010e4cae1e4d46cc85302ab4d6,2,Sat 26 Sep 2020 11:54:17 AM EDT,
diff --git a/sql/functions.sql b/sql/functions.sql
new file mode 100644 (file)
index 0000000..6a26927
--- /dev/null
@@ -0,0 +1,105 @@
+--------------------------------
+-- Weight
+--------------------------------
+
+SELECT
+  date,
+  users.name,
+  notes,
+  (
+    SELECT
+      value
+    FROM
+      bio_log_entry
+    WHERE
+      biometric_id = 2
+      AND log_id = biometric_log.id) AS weight
+FROM
+  biometric_log
+  INNER JOIN users ON user_id = users.id
+  INNER JOIN bio_log_entry ON biometric_id = 2
+    AND log_id = biometric_log.id
+WHERE
+  users.name = 'Mark';
+
+--------------------------------
+-- Pulse and blood pressure
+--------------------------------
+
+SELECT
+  date,
+  users.name,
+  (
+    SELECT
+      value
+    FROM
+      bio_log_entry
+    WHERE
+      biometric_id = 23
+      AND log_id = biometric_log.id) AS sys,
+  (
+    SELECT
+      value
+    FROM
+      bio_log_entry
+    WHERE
+      biometric_id = 24
+      AND log_id = biometric_log.id) AS dia,
+  (
+    SELECT
+      value
+    FROM
+      bio_log_entry
+    WHERE
+      biometric_id = 22
+      AND log_id = biometric_log.id) AS pulse,
+  notes
+FROM
+  biometric_log
+  INNER JOIN users ON user_id = users.id;
+
+-- LEFT JOIN bio_log_entry ON biometric_id IN (22,23,24);
+SELECT
+  date,
+  users.name,
+  notes,
+  (
+    SELECT
+      (
+        SELECT
+          value
+        FROM
+          bio_log_entry
+        WHERE
+          biometric_id = 23
+          AND log_id = biometric_log.id) || '/' || (
+          SELECT
+            value
+          FROM
+            bio_log_entry
+          WHERE
+            biometric_id = 24
+            AND log_id = biometric_log.id) || ' (' || (
+            SELECT
+              value
+            FROM
+              bio_log_entry
+            WHERE
+              biometric_id = 22
+              AND log_id = biometric_log.id) || ' bpm)') AS summary
+      FROM
+        biometric_log
+        INNER JOIN users ON user_id = users.id;
+
+SELECT
+  users.name,
+  date,
+  notes,
+  biometrics.name,
+  bio_log_entry.value
+FROM
+  biometric_log
+  INNER JOIN users ON user_id = users.id
+  INNER JOIN bio_log_entry ON log_id = biometric_log.id
+  INNER JOIN biometrics ON biometric_id = biometrics.id;
+
index ea61145803445a183e9067fe09867796eaaefcca..46733adcb2e12c917e204ebc3fbc6d071ead6ffc 100644 (file)
@@ -29,5 +29,8 @@
 
 .import '| tail -n +2 ./data/food_log.csv' food_log
 
+.import '| tail -n +2 ./data/biometric_log.csv' biometric_log
+.import '| tail -n +2 ./data/bio_log_entry.csv' bio_log_entry
+
 .header on
 .mode column
index f02128891c6973b13c5bfef8c5ef2df54fa6ab4a..08fb592e406b708303d1ca6d469b02875e2465ef 100644 (file)
@@ -76,13 +76,20 @@ CREATE TABLE biometric_log (
   id integer PRIMARY KEY AUTOINCREMENT,
   guid text NOT NULL DEFAULT (lower(hex (randomblob (16)))) UNIQUE,
   user_id int NOT NULL,
-  date date DEFAULT CURRENT_DATE,
+  date int DEFAULT (strftime ('%s', 'now')),
+  notes text,
+  FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE
+);
+
+
+CREATE TABLE bio_log_entry (
+  log_id int NOT NULL,
   biometric_id int NOT NULL,
   value real NOT NULL,
-  FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE,
+  PRIMARY KEY (log_id, biometric_id),
+  FOREIGN KEY (log_id) REFERENCES biometric_log (id) ON UPDATE CASCADE,
   FOREIGN KEY (biometric_id) REFERENCES biometrics (id) ON UPDATE CASCADE
 );
-
 --
 --------------------------------
 -- Recipes
@@ -101,7 +108,7 @@ CREATE TABLE recipe_dat (
   food_id int NOT NULL,
   grams real NOT NULL,
   notes text,
-  UNIQUE (recipe_id, food_id),
+  PRIMARY KEY (recipe_id, food_id),
   FOREIGN KEY (recipe_id) REFERENCES recipes (id) ON UPDATE CASCADE
 );
 
@@ -152,7 +159,7 @@ CREATE TABLE rda (
   nutr_id int NOT NULL,
   rda real NOT NULL,
   synced int DEFAULT 0,
-  UNIQUE (user_id, nutr_id),
+  PRIMARY KEY (user_id, nutr_id),
   FOREIGN KEY (user_id) REFERENCES users (id) ON UPDATE CASCADE
 );