Use string for date & datetime

This commit is contained in:
Zoe Roux 2024-11-08 22:32:19 +01:00
parent 4f74ffc5ce
commit 78e84cf960
No known key found for this signature in database
3 changed files with 12 additions and 11 deletions

View File

@ -37,8 +37,8 @@ export const entries = schema.table(
externalId: jsonb().notNull().default({}),
createdAt: timestamp({ withTimezone: true }).defaultNow(),
nextRefresh: timestamp({ withTimezone: true }),
createdAt: timestamp({ withTimezone: true, mode: "string" }).defaultNow(),
nextRefresh: timestamp({ withTimezone: true, mode: "string" }),
},
(t) => ({
// episodeKey: unique().on(t.showId, t.seasonNumber, t.episodeNumber),

View File

@ -56,14 +56,16 @@ export const shows = schema.table(
rating: smallint(),
runtime: integer(),
status: showStatus().notNull(),
startAir: date({ mode: "date" }),
endAir: date({ mode: "date" }),
startAir: date(),
endAir: date(),
originalLanguage: language(),
externalId: externalid(),
createdAt: timestamp({ withTimezone: true }).notNull().defaultNow(),
nextRefresh: timestamp({ withTimezone: true }).notNull(),
createdAt: timestamp({ withTimezone: true, mode: "string" })
.notNull()
.defaultNow(),
nextRefresh: timestamp({ withTimezone: true, mode: "string" }).notNull(),
},
(t) => ({
ratingValid: check(

View File

@ -17,18 +17,17 @@ export const Movie = t.Object({
status: ShowStatus,
runtime: t.Nullable(t.Number({ minimum: 0 })),
airDate: t.Nullable(t.Date()),
airDate: t.Nullable(t.String({ format: "date" })),
originalLanguage: t.Nullable(t.String()),
trailerUrl: t.Nullable(t.String()),
poster: t.Nullable(Image),
thumbnail: t.Nullable(Image),
banner: t.Nullable(Image),
logo: t.Nullable(Image),
trailerUrl: t.Nullable(t.String()),
// this is a datetime, not just a date.
createdAt: t.Date(),
nextRefresh: t.Date(),
createdAt: t.String({ format: "date-time" }),
nextRefresh: t.String({ format: "date-time" }),
externalId: ExternalId,
});