From: gamesguru Date: Wed, 29 Sep 2021 23:52:38 +0000 (-0400) Subject: use msre_id instead of grams on food_log X-Git-Tag: 0.0.5~16 X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=3de91d20b8f919d2e1a79eb6f5a45fbc1ab6cbbc;p=nutratech%2Fnt-sqlite.git use msre_id instead of grams on food_log --- diff --git a/sql/data/food_log.csv b/sql/data/food_log.csv index 986a00a..65808e3 100644 --- a/sql/data/food_log.csv +++ b/sql/data/food_log.csv @@ -1,23 +1,23 @@ -id,profile_id,created,updated,date,meal_id,food_id,grams -1,1,1601977400,1601977400,2020-09-20,1,13047,100 -2,1,1601977400,1601977400,2020-09-20,1,1270,28 -3,1,1601977400,1601977400,2020-09-20,1,9038,55 -4,1,1601977400,1601977400,2020-09-20,1,11251,20 -5,1,1601977400,1601977400,2020-09-20,1,11529,35 -6,1,1601977400,1601977400,2020-09-20,1,11282,15 -7,1,1601977400,1601977400,2020-09-20,1,11828,210 -8,1,1601977400,1601977400,2020-09-20,1,28313,40 -9,1,1601977400,1601977400,2020-09-20,1,9112,100 -10,1,1601977400,1601977400,2020-09-20,2,20137,140 -11,1,1601977400,1601977400,2020-09-20,2,5062,100 -12,1,1601977400,1601977400,2020-09-20,2,12136,45 -13,1,1601977400,1601977400,2020-09-20,2,11821,50 -14,1,1601977400,1601977400,2020-09-20,2,44005,15 -15,1,1601977400,1601977400,2020-09-20,3,20545,150 -16,1,1601977400,1601977400,2020-09-20,3,16146,85 -17,1,1601977400,1601977400,2020-09-20,3,1270,40 -18,1,1601977400,1601977400,2020-09-20,3,9037,60 -19,1,1601977400,1601977400,2020-09-20,3,15076,100 -20,1,1601977400,1601977400,2020-09-20,3,11090,60 -21,1,1601977400,1601977400,2020-09-20,3,11938,35 -22,1,1601977400,1601977400,2020-09-20,3,11282,25 +id,profile_id,created,updated,date,meal_id,food_id,msre_id,amt +1,1,1601977400,1601977400,2020-09-20,1,13047,-1,100 +2,1,1601977400,1601977400,2020-09-20,1,1270,-1,28 +3,1,1601977400,1601977400,2020-09-20,1,9038,-1,55 +4,1,1601977400,1601977400,2020-09-20,1,11251,-1,20 +5,1,1601977400,1601977400,2020-09-20,1,11529,-1,35 +6,1,1601977400,1601977400,2020-09-20,1,11282,-1,15 +7,1,1601977400,1601977400,2020-09-20,1,11828,-1,210 +8,1,1601977400,1601977400,2020-09-20,1,28313,-1,40 +9,1,1601977400,1601977400,2020-09-20,1,9112,-1,100 +10,1,1601977400,1601977400,2020-09-20,2,20137,-1,140 +11,1,1601977400,1601977400,2020-09-20,2,5062,-1,100 +12,1,1601977400,1601977400,2020-09-20,2,12136,-1,45 +13,1,1601977400,1601977400,2020-09-20,2,11821,-1,50 +14,1,1601977400,1601977400,2020-09-20,2,44005,-1,15 +15,1,1601977400,1601977400,2020-09-20,3,20545,-1,150 +16,1,1601977400,1601977400,2020-09-20,3,16146,-1,85 +17,1,1601977400,1601977400,2020-09-20,3,1270,-1,40 +18,1,1601977400,1601977400,2020-09-20,3,9037,-1,60 +19,1,1601977400,1601977400,2020-09-20,3,15076,-1,100 +20,1,1601977400,1601977400,2020-09-20,3,11090,-1,60 +21,1,1601977400,1601977400,2020-09-20,3,11938,-1,35 +22,1,1601977400,1601977400,2020-09-20,3,11282,-1,25 diff --git a/sql/tables.sql b/sql/tables.sql index 656b803..945e6df 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -152,7 +152,8 @@ CREATE TABLE food_log ( date int DEFAULT (strftime ('%s', 'now')), meal_id int NOT NULL, food_id int NOT NULL, - grams real NOT NULL, + msre_id int NOT NULL, + amt real NOT NULL, FOREIGN KEY (profile_id) REFERENCES profiles (id) ON UPDATE CASCADE, FOREIGN KEY (meal_id) REFERENCES meal_name (id) ON UPDATE CASCADE );