diff --git a/backend/sql/version_1.sql b/backend/sql/version_1.sql index 0e44445..446d79e 100644 --- a/backend/sql/version_1.sql +++ b/backend/sql/version_1.sql @@ -69,7 +69,7 @@ CREATE TABLE [Recipe] ( [id] INTEGER PRIMARY KEY, [user_id] INTEGER, -- Can be null if a user is deleted. [title] TEXT NOT NULL, - -- https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes + -- https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes (Set 1). [lang] TEXT NOT NULL DEFAULT 'en', [estimated_time] INTEGER, -- in [s]. [description] TEXT NOT NULL DEFAULT '', @@ -80,6 +80,7 @@ CREATE TABLE [Recipe] ( [creation_datetime] TEXT NOT NULL, CHECK ( + length([lang]) = 2 AND length([title]) <= 255 AND length([description]) <= 65535 AND [difficulty] >= 0 AND [difficulty] <= 3