new data format with more information
This commit is contained in:
parent
18de2714d0
commit
07bfc65b67
8 changed files with 109 additions and 2 deletions
23
src/migrations/2.sql
Normal file
23
src/migrations/2.sql
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
ALTER TABLE
|
||||
food
|
||||
ADD COLUMN
|
||||
-- per 100g
|
||||
protein REAL NOT NULL DEFAULT 5.0 CHECK (protein > 0);
|
||||
|
||||
ALTER TABLE
|
||||
food
|
||||
ADD COLUMN
|
||||
-- per 100g
|
||||
fiber REAL NOT NULL DEFAULT 5.0 CHECK (fiber > 0);
|
||||
|
||||
ALTER TABLE
|
||||
food
|
||||
ADD COLUMN
|
||||
protein_per_portion REAL NOT NULL GENERATED ALWAYS AS ((protein / 100) * portion_weight) VIRTUAL;
|
||||
|
||||
ALTER TABLE
|
||||
food
|
||||
ADD COLUMN
|
||||
fiber_per_portion REAL NOT NULL GENERATED ALWAYS AS ((fiber / 100) * portion_weight) VIRTUAL;
|
||||
|
||||
PRAGMA user_version = 2;
|
||||
Loading…
Add table
Add a link
Reference in a new issue