Add video migration & runtime field on shows

This commit is contained in:
Zoe Roux
2024-11-08 22:30:49 +01:00
parent f53e8e3611
commit 4f74ffc5ce
5 changed files with 582 additions and 1 deletions
+2 -1
View File
@@ -3,7 +3,6 @@ import {
check,
date,
integer,
jsonb,
primaryKey,
smallint,
text,
@@ -55,6 +54,7 @@ export const shows = schema.table(
kind: showKind().notNull(),
genres: genres().array().notNull(),
rating: smallint(),
runtime: integer(),
status: showStatus().notNull(),
startAir: date({ mode: "date" }),
endAir: date({ mode: "date" }),
@@ -70,6 +70,7 @@ export const shows = schema.table(
"ratingValid",
sql`0 <= ${t.rating} && ${t.rating} <= 100`,
),
runtimeValid: check("runtimeValid", sql`0 <= ${t.runtime}`),
}),
);
+1
View File
@@ -15,6 +15,7 @@ export const Movie = t.Object({
genres: t.Array(Genre),
rating: t.Nullable(t.Number({ minimum: 0, maximum: 100 })),
status: ShowStatus,
runtime: t.Nullable(t.Number({ minimum: 0 })),
airDate: t.Nullable(t.Date()),
originalLanguage: t.Nullable(t.String()),