From: Shane Jaroch Date: Sun, 24 Jul 2022 18:43:40 +0000 (-0400) Subject: use relative import; remove recipe_id FK X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=0eb89de7db73aa68d71da3b4113296ba595500bd;p=nutratech%2Fnt-sqlite.git use relative import; remove recipe_id FK --- diff --git a/sql/__main__.py b/sql/__main__.py index 1c9ad09..f9e8795 100644 --- a/sql/__main__.py +++ b/sql/__main__.py @@ -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) diff --git a/sql/tables.sql b/sql/tables.sql index 4840986..b840fad 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -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 ); --