Recipe can now be scheduled

This commit is contained in:
Greg Burri 2025-02-04 22:29:56 +01:00
parent ae6da1a5ae
commit fbef990022
18 changed files with 233 additions and 51 deletions

View file

@ -1,3 +1,6 @@
-- Datetimes are stored as 'ISO 8601' text format.
-- For example: '2025-01-07T10:41:05.697884837+00:00'.
-- Version 1 is the initial structure.
CREATE TABLE [Version] (
[id] INTEGER PRIMARY KEY,
@ -165,9 +168,11 @@ CREATE TABLE [RecipeScheduled] (
[id] INTEGER PRIMARY KEY,
[user_id] INTEGER NOT NULL,
[recipe_id] INTEGER NOT NULL,
[date] TEXT NOT NULL,
[date] TEXT NOT NULL, -- In form of 'YYYY-MM-DD'.
[servings] INTEGER, -- If NULL use [recipe].[servings].
UNIQUE([user_id], [recipe_id], [date]),
FOREIGN KEY([user_id]) REFERENCES [User]([id]) ON DELETE CASCADE,
FOREIGN KEY([recipe_id]) REFERENCES [Recipe]([id]) ON DELETE CASCADE
);