fixes for postgres type stuff

mike/cropping
Mike Lang 2 years ago
parent 46d9ecd5de
commit 1d6ca09383

@ -17,10 +17,12 @@ from psycogreen.gevent import patch_psycopg
COMPOSITE_TYPES = [ COMPOSITE_TYPES = [
"video_range", "video_range",
"video_transition", "video_transition",
"public.box",
] ]
COLUMN_CASTS = { COLUMN_CASTS = {
"video_ranges": "video_range[]", "video_ranges": "video_range[]",
"video_transitions": "video_transition[]", "video_transitions": "video_transition[]",
"video_crop": "public.box",
} }
def get_column_placeholder(column): def get_column_placeholder(column):

@ -95,7 +95,7 @@ CREATE TABLE events (
(video_ranges IS NULL AND video_transitions IS NULL) (video_ranges IS NULL AND video_transitions IS NULL)
OR CARDINALITY(video_ranges) = CARDINALITY(video_transitions) + 1 OR CARDINALITY(video_ranges) = CARDINALITY(video_transitions) + 1
), ),
video_crop box, video_crop public.box,
video_title TEXT CHECK (state IN ('UNEDITED', 'DONE') OR video_title 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_description TEXT CHECK (state IN ('UNEDITED', 'DONE') OR video_description IS NOT NULL),
video_tags TEXT[] CHECK (state IN ('UNEDITED', 'DONE') OR video_tags IS NOT NULL), video_tags TEXT[] CHECK (state IN ('UNEDITED', 'DONE') OR video_tags IS NOT NULL),

Loading…
Cancel
Save