]> Nutra Git (v1) - nutratech/nt-sqlite.git/commitdiff
use relative import; remove recipe_id FK
authorShane Jaroch <chown_tee@proton.me>
Sun, 24 Jul 2022 18:43:40 +0000 (14:43 -0400)
committerShane Jaroch <chown_tee@proton.me>
Sun, 24 Jul 2022 18:43:40 +0000 (14:43 -0400)
sql/__main__.py
sql/tables.sql

index 1c9ad095f5df5c998884147afccad0932d4fe8c8..f9e87952a0562bc6aef15de051933c639e1282e4 100644 (file)
@@ -1,6 +1,6 @@
 """Call this with python -m sql"""
 # pylint: disable=import-error
-from sql import build_ntsqlite
+from . import build_ntsqlite
 
 if __name__ == "__main__":
     build_ntsqlite(verbose=True)
index 484098616751cd863a7509a16c8a09574f99291f..b840fada3487fae131639a20d5aefc2d7530a743 100644 (file)
@@ -145,8 +145,7 @@ CREATE TABLE log_recipe (
   grams real NOT NULL,
   created int DEFAULT (strftime ('%s', 'now')),
   FOREIGN KEY (profile_id) REFERENCES profile (id) ON UPDATE CASCADE ON DELETE CASCADE,
-  FOREIGN KEY (meal_id) REFERENCES meal_name (id) ON UPDATE CASCADE ON DELETE CASCADE,
-  FOREIGN KEY (recipe_id) REFERENCES recipe (id) ON UPDATE CASCADE ON DELETE CASCADE
+  FOREIGN KEY (meal_id) REFERENCES meal_name (id) ON UPDATE CASCADE ON DELETE CASCADE
 );
 
 --