From: gamesguru Date: Fri, 21 May 2021 23:13:18 +0000 (-0400) Subject: modify costs table, bump version 0.0.1 X-Git-Tag: 0.0.1 X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=6300fd609bccce375f4b491b3c01f9606502a229;p=nutratech%2Fnt-sqlite.git modify costs table, bump version 0.0.1 --- diff --git a/sql/data/version.csv b/sql/data/version.csv index 781973d..088ffe7 100644 --- a/sql/data/version.csv +++ b/sql/data/version.csv @@ -1,2 +1,3 @@ id,version,created,notes -1,0.0.0,2020-09-22,"initial release" +1,0.0.0,2020-09-22,initial release +2,0.0.1,2021-05-21,bump version diff --git a/sql/tables.sql b/sql/tables.sql index 550930b..e54d956 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -62,10 +62,11 @@ CREATE TABLE profiles ( -------------------------------- CREATE TABLE food_costs ( - id integer PRIMARY KEY AUTOINCREMENT, - profile_id integer NOT NULL, food_id integer NOT NULL, - cost real NOT NULL + profile_id integer NOT NULL, + cost real NOT NULL, + PRIMARY KEY (food_id, profile_id), + FOREIGN KEY (profile_id) REFERENCES profiles (id) ON UPDATE CASCADE ON DELETE CASCADE ); --