From 56392adc0a1bc3604c48d7f5d46dceede13223cc Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Sat, 24 Sep 2022 11:26:13 +0200 Subject: [PATCH] feat: extend db scheme (Issues #15, #24 & #25) --- helper_scripts/sqlite3.init | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/helper_scripts/sqlite3.init b/helper_scripts/sqlite3.init index 5c2284d..e148194 100644 --- a/helper_scripts/sqlite3.init +++ b/helper_scripts/sqlite3.init @@ -6,6 +6,26 @@ create TABLE person( "energyTarget" INTEGER ); +create TABLE curated_food( + "food_id" TEXT NOT NULL PRIMARY KEY +); + +create TABLE food_preferences( + "food_id" TEXT NOT NULL PRIMARY KEY, + "value" INTEGER +); + +create TABLE food_templates( + "template_name" TEXT PRIMARY KEY, + "template_description" +); + +create TABLE foods_in_template( + "template_name" TEST, + "food_id" TEXT, + "amount" INTEGER +); + create TABLE foodlog( "food_id" TEXT, "date" INTEGER, @@ -28,6 +48,11 @@ CREATE TABLE weightByDate( CONSTRAINT weight_pk PRIMARY KEY (date) ); +CREATE TABLE calorieTargetByDate( + "date" TEXT NOT NULL PRIMARY KEY, + "target" INTEGER +); + .mode csv .import food_filtered.csv food .import food_portion.csv food_portion