Files
sexy/packages/backend/src/db/schema/files.ts
Sebastian Krüger efc7624ba3
All checks were successful
Build and Push Backend Image / build (push) Successful in 46s
Build and Push Frontend Image / build (push) Successful in 5m12s
style: apply prettier formatting to all files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 22:27:54 +01:00

23 lines
719 B
TypeScript

import { pgTable, text, timestamp, bigint, integer, index } from "drizzle-orm/pg-core";
export const files = pgTable(
"files",
{
id: text("id")
.primaryKey()
.$defaultFn(() => crypto.randomUUID()),
title: text("title"),
description: text("description"),
filename: text("filename").notNull(),
mime_type: text("mime_type"),
filesize: bigint("filesize", { mode: "number" }),
duration: integer("duration"),
uploaded_by: text("uploaded_by"),
date_created: timestamp("date_created").notNull().defaultNow(),
},
(t) => [index("files_uploaded_by_idx").on(t.uploaded_by)],
);
export type File = typeof files.$inferSelect;
export type NewFile = typeof files.$inferInsert;