Recipe can now be scheduled
This commit is contained in:
parent
ae6da1a5ae
commit
fbef990022
18 changed files with 233 additions and 51 deletions
|
|
@ -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
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue