Files
lensflix/lib/db/schema.ts
T
2026-06-10 18:30:46 +02:00

28 lines
586 B
TypeScript

import {
integer,
jsonb,
pgTable,
serial,
timestamp,
uniqueIndex,
varchar,
} from "drizzle-orm/pg-core";
export const cardCache = pgTable(
"card_cache",
{
id: serial("id").primaryKey(),
movieId: integer("movie_id").notNull(),
cardType: varchar("card_type", { length: 50 }).notNull(),
payload: jsonb("payload").notNull(),
createdAt: timestamp("created_at", { withTimezone: true })
.defaultNow()
.notNull(),
},
(table) => [
uniqueIndex("card_cache_movie_card_unique").on(
table.movieId,
table.cardType,
),
],
);