diff --git a/backend/sql/version_1.sql b/backend/sql/version_1.sql index 19b233c..640fb9e 100644 --- a/backend/sql/version_1.sql +++ b/backend/sql/version_1.sql @@ -257,7 +257,9 @@ CREATE TABLE [ShoppingEntry] ( -- In both cases [name], [quantity_value], [quantity_unit] and [Servings] are used to display -- the entry instead of [Ingredient] data. [ingredient_id] INTEGER, - [recipe_scheduled_id] INTEGER, -- Can be null when manually added. + + -- Can be null when manually added (entry is not linked to a recipe). + [recipe_scheduled_id] INTEGER, [is_checked] INTEGER NOT NULL DEFAULT FALSE, @@ -269,16 +271,7 @@ CREATE TABLE [ShoppingEntry] ( CHECK ( length([name]) <= 255 AND - ([is_checked] = TRUE OR [is_checked] = FALSE) AND - ( - [recipe_scheduled_id] IS NULL OR - ( - [name] = '' AND - [quantity_value] IS NULL AND - [quantity_unit] = '' AND - [servings] IS NULL - ) - ) + ([is_checked] = TRUE OR [is_checked] = FALSE) ), FOREIGN KEY([user_id]) REFERENCES [User]([id]) ON DELETE CASCADE,