From: gamesguru Date: Sun, 11 Oct 2020 17:57:03 +0000 (-0400) Subject: stuff X-Git-Tag: 0.0.0~2 X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=3c25704b22f76c10eaca841272582955b8799539;p=nutratech%2Fnt-sqlite.git stuff --- diff --git a/docs/nt.svg b/docs/nt.svg index caa1521..d37a306 100644 --- a/docs/nt.svg +++ b/docs/nt.svg @@ -4,313 +4,326 @@ - - + + undefined - -nt.sqlite + +nt.sqlite version - -version - -id* -integer -version -text -created -date -notes -text + +version + +id* +integer +version +text +created +date +notes +text bmr_eqs - -bmr_eqs - -id* -integer -name -text + +bmr_eqs + +id* +integer +name +text bf_eqs - -bf_eqs - -id* -integer -name -text + +bf_eqs + +id* +integer +name +text - + -users - -users - -id* -integer -name -text -guid -text -created -int -eula -int -gender -text -dob -date -act_lvl -int -goal_wt -real -goal_bf -real -bmr_eq_id -int -bf_eq_id -int +profiles + +profiles + +id* +integer +name +text +guid +text +created +int +updated +int +last_sync +int +eula +int +gender +text +dob +date +act_lvl +int +goal_wt +real +goal_bf +real +bmr_eq_id +int +bf_eq_id +int - + -users->bmr_eqs - - +profiles->bmr_eqs + + - + -users->bf_eqs - - +profiles->bf_eqs + + biometrics - -biometrics - -id* -integer -name -text -unit -text -created -int + +biometrics + +id* +integer +name +text +unit +text +created +int biometric_log - -biometric_log - -id* -integer -guid -text -user_id -int -date -int -tags -text -notes -text + +biometric_log + +id* +integer +guid +text +profile_id +int +created +int +updated +int +last_sync +int +date +int +tags +text +notes +text - + -biometric_log->users - - +biometric_log->profiles + + bio_log_entry - -bio_log_entry - -log_id* -int -biometric_id* -int -value -real + +bio_log_entry + +log_id* +int +biometric_id* +int +value +real bio_log_entry->biometrics - - + + bio_log_entry->biometric_log - - + + recipes - -recipes - -id* -integer -guid -text -created -int -name -text + +recipes + +id* +integer +guid +text +created +int +updated +int +last_sync +int +name +text recipe_dat - -recipe_dat - -recipe_id* -int -food_id* -int -grams -real -notes -text + +recipe_dat + +recipe_id* +int +food_id* +int +grams +real +notes +text recipe_dat->recipes - - + + meals - -meals - -id* -integer -name -text + +meals + +id* +integer +name +text food_log - -food_log - -id* -integer -guid -text -user_id -int -date -date -meal_id -int -food_id -int -grams -real + +food_log + +id* +integer +guid +text +profile_id +int +created +int +updated +int +last_sync +int +date +date +meal_id +int +food_id +int +grams +real - + -food_log->users - - +food_log->profiles + + food_log->meals - - + + recipe_log - -recipe_log - -id* -integer -guid -text -user_id -int -date -date -meal_id -int -recipe_id -int -grams -real + +recipe_log + +id* +integer +guid +text +profile_id +int +created +int +updated +int +last_sync +int +date +date +meal_id +int +recipe_id +int +grams +real - + -recipe_log->users - - +recipe_log->profiles + + recipe_log->recipes - - + + recipe_log->meals - - + + rda - -rda - -user_id* -int -nutr_id* -int -rda -real -synced -int + +rda + +profile_id* +int +created +int +updated +int +last_sync +int +nutr_id* +int +rda +real - + -rda->users - - - - - -sync_data - -sync_data - -id* -integer -tablename -text -guid -text -constraint -text -action -text +rda->profiles + + diff --git a/sql/data/profiles.csv b/sql/data/profiles.csv index 4bd3da4..ffb4b03 100644 --- a/sql/data/profiles.csv +++ b/sql/data/profiles.csv @@ -1,4 +1,4 @@ id,name,guid,created,updated,last_sync,eula,gender,dob,act_lvl,goal_wt,goal_bf,bmr_id,bf_id -1,Shane,a0fdac7ab369de43f029a460879c854f,1601067725,1601067725,-1,1,MALE,1993-01-01,2,78,0.12,1,1 -2,Mark,7abf05c84beb849628a44336acfe7a5b,1601068574,1601068574,-1,1,MALE,1957-01-01,2,72,0.14,1,1 -3,Rocky,2454c8ab7c575cd2610f9977ed3b2b61,1601068718,1601068718,-1,1,DOG,2007-08-01,2,7.3,,1,1 +1,Shane,a0fdac7ab369de43f029a460879c854f,1601067725,1601067725,-1,,MALE,1993-01-01,2,78,0.12,1,1 +2,Mark,7abf05c84beb849628a44336acfe7a5b,1601068574,1601068574,-1,,MALE,1957-01-01,2,72,0.14,1,1 +3,Rocky,2454c8ab7c575cd2610f9977ed3b2b61,1601068718,1601068718,-1,,DOG,2007-08-01,2,7.3,,1,1 diff --git a/sql/functions.sql b/sql/functions.sql index cd375c1..851a704 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -172,8 +172,16 @@ GROUP BY SELECT max(( + SELECT + last_sync FROM profiles), ( SELECT last_sync FROM biometric_log), ( SELECT - last_sync FROM biometric_log)); + last_sync FROM recipes), ( + SELECT + last_sync FROM food_log), ( + SELECT + last_sync FROM recipe_log), ( + SELECT + last_sync FROM rda)) AS last_sync;