From 6300fd609bccce375f4b491b3c01f9606502a229 Mon Sep 17 00:00:00 2001 From: gamesguru Date: Fri, 21 May 2021 19:13:18 -0400 Subject: [PATCH] modify costs table, bump version 0.0.1 --- sql/data/version.csv | 3 ++- sql/tables.sql | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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 ); -- -- 2.52.0