Add collection type in database

This commit is contained in:
Zoe Roux
2025-03-02 00:39:54 +01:00
parent 5535507469
commit dbfe836ce3
4 changed files with 1073 additions and 1 deletions
+10 -1
View File
@@ -1,5 +1,6 @@
import { relations, sql } from "drizzle-orm";
import {
type AnyPgColumn,
check,
date,
index,
@@ -16,7 +17,11 @@ import { entries } from "./entries";
import { seasons } from "./seasons";
import { image, language, schema } from "./utils";
export const showKind = schema.enum("show_kind", ["serie", "movie"]);
export const showKind = schema.enum("show_kind", [
"serie",
"movie",
"collection",
]);
export const showStatus = schema.enum("show_status", [
"unknown",
"finished",
@@ -78,6 +83,10 @@ export const shows = schema.table(
endAir: date(),
originalLanguage: language(),
collectionPk: integer().references((): AnyPgColumn => shows.pk, {
onDelete: "set null",
}),
externalId: externalid(),
createdAt: timestamp({ withTimezone: true, mode: "string" })