Remove useless check

This commit is contained in:
Greg Burri 2025-06-06 22:31:02 +02:00
parent f228486c5a
commit d9bdb32419

View file

@ -257,7 +257,9 @@ CREATE TABLE [ShoppingEntry] (
-- In both cases [name], [quantity_value], [quantity_unit] and [Servings] are used to display -- In both cases [name], [quantity_value], [quantity_unit] and [Servings] are used to display
-- the entry instead of [Ingredient] data. -- the entry instead of [Ingredient] data.
[ingredient_id] INTEGER, [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, [is_checked] INTEGER NOT NULL DEFAULT FALSE,
@ -269,16 +271,7 @@ CREATE TABLE [ShoppingEntry] (
CHECK ( CHECK (
length([name]) <= 255 AND length([name]) <= 255 AND
([is_checked] = TRUE OR [is_checked] = FALSE) AND ([is_checked] = TRUE OR [is_checked] = FALSE)
(
[recipe_scheduled_id] IS NULL OR
(
[name] = '' AND
[quantity_value] IS NULL AND
[quantity_unit] = '' AND
[servings] IS NULL
)
)
), ),
FOREIGN KEY([user_id]) REFERENCES [User]([id]) ON DELETE CASCADE, FOREIGN KEY([user_id]) REFERENCES [User]([id]) ON DELETE CASCADE,