Add asynchronous call to database.

See file 'asynchronous.ts'.
This commit is contained in:
Greg Burri 2022-11-29 15:58:06 +01:00
parent 8a3fef096d
commit d28e765e39
20 changed files with 1323 additions and 1049 deletions

View file

@ -46,6 +46,26 @@ CREATE TABLE [Recipe] (
FOREIGN KEY([user_id]) REFERENCES [User]([id]) ON DELETE SET NULL
);
CREATE TABLE [RecipeTag] (
[id] INTEGER PRIMARY KEY,
[recipe_id] INTEGER NOT NULL,
[tag_id] INTEGER NO NULL,
FOREIGN KEY([recipe_id]) REFERENCES [Recipe]([id]) ON DELETE CASCADE,
FOREIGN KEY([tag_id]) REFERENCES [Tag]([id]) ON DELETE CASCADE
);
CREATE TABLE [Tag] (
[id] INTEGER PRIMARY KEY,
[recipe_tag_id] INTEGER,
[name] TEXT NOT NULL,
FOREIGN KEY([recipe_tag_id]) REFERENCES [RecipeTag]([id]) ON DELETE SET NULL
);
CREATE UNIQUE INDEX [Tag_name_index] ON [Tag] ([name]);
CREATE TABLE [Quantity] (
[id] INTEGER PRIMARY KEY,
[value] REAL,