diff --git a/common/common/database.py b/common/common/database.py index 548e8e2..5c63e4c 100644 --- a/common/common/database.py +++ b/common/common/database.py @@ -43,14 +43,14 @@ CREATE TABLE IF NOT EXISTS events ( allow_holes BOOLEAN NOT NULL DEFAULT FALSE, uploader_whitelist TEXT[], upload_location TEXT CHECK (state = 'UNEDITED' OR upload_location IS NOT NULL), - video_start TIMESTAMP CHECK (state = 'UNEDITED' OR video_start IS NOT NULL), - video_end TIMESTAMP CHECK (state = 'UNEDITED' OR video_end IS NOT NULL), - video_title TEXT CHECK (state = 'UNEDITED' OR video_title IS NOT NULL), - video_description TEXT CHECK (state = 'UNEDITED' OR video_description IS NOT NULL), - video_channel TEXT CHECK (state = 'UNEDITED' OR video_channel IS NOT NULL), + video_start TIMESTAMP CHECK (state IN ('UNEDITED', 'DONE') OR video_start IS NOT NULL), + video_end TIMESTAMP CHECK (state IN ('UNEDITED', 'DONE') OR video_end IS NOT NULL), + video_title TEXT CHECK (state IN ('UNEDITED', 'DONE') OR video_title IS NOT NULL), + video_description TEXT CHECK (state IN ('UNEDITED', 'DONE') OR video_description IS NOT NULL), + video_channel TEXT CHECK (state IN ('UNEDITED', 'DONE') OR video_channel IS NOT NULL), video_quality TEXT NOT NULL DEFAULT 'source', state event_state NOT NULL DEFAULT 'UNEDITED', - uploader TEXT, + uploader TEXT CHECK (state IN ('UNEDITED', 'EDITED', 'DONE') OR uploader IS NOT NULL), error TEXT, video_id TEXT, video_link TEXT CHECK (state != 'DONE' OR video_link IS NOT NULL)