modify costs table, bump version 0.0.1 0.0.1
authorgamesguru <mathmuncher11@gmail.com>
Fri, 21 May 2021 23:13:18 +0000 (19:13 -0400)
committergamesguru <mathmuncher11@gmail.com>
Fri, 21 May 2021 23:13:18 +0000 (19:13 -0400)
sql/data/version.csv
sql/tables.sql

index 781973d6921667afc3ed9aef3e0e30584761f975..088ffe72c7b73ab653c1ac1664bbe6ee28c3eeef 100644 (file)
@@ -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
index 550930b349cabf23feb980fb3ed5047e8bd676ba..e54d9567a9b5f963d7653b3ba2f7239f5c80738a 100644 (file)
@@ -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
 );
 
 --