Check on [Recipe].[lang]
This commit is contained in:
parent
d2733ccf01
commit
eb47844f05
1 changed files with 2 additions and 1 deletions
|
|
@ -69,7 +69,7 @@ CREATE TABLE [Recipe] (
|
||||||
[id] INTEGER PRIMARY KEY,
|
[id] INTEGER PRIMARY KEY,
|
||||||
[user_id] INTEGER, -- Can be null if a user is deleted.
|
[user_id] INTEGER, -- Can be null if a user is deleted.
|
||||||
[title] TEXT NOT NULL,
|
[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',
|
[lang] TEXT NOT NULL DEFAULT 'en',
|
||||||
[estimated_time] INTEGER, -- in [s].
|
[estimated_time] INTEGER, -- in [s].
|
||||||
[description] TEXT NOT NULL DEFAULT '',
|
[description] TEXT NOT NULL DEFAULT '',
|
||||||
|
|
@ -80,6 +80,7 @@ CREATE TABLE [Recipe] (
|
||||||
[creation_datetime] TEXT NOT NULL,
|
[creation_datetime] TEXT NOT NULL,
|
||||||
|
|
||||||
CHECK (
|
CHECK (
|
||||||
|
length([lang]) = 2 AND
|
||||||
length([title]) <= 255 AND
|
length([title]) <= 255 AND
|
||||||
length([description]) <= 65535 AND
|
length([description]) <= 65535 AND
|
||||||
[difficulty] >= 0 AND [difficulty] <= 3
|
[difficulty] >= 0 AND [difficulty] <= 3
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue