- Frontend: React 18→19, Next.js 15→16, major package updates - Backend: Prisma 5→7 with adapter pattern, Express 4→5 - Added Prisma 7 config (prisma.config.ts) and PostgreSQL adapter - Updated Next.js config for Turbopack compatibility - All builds passing successfully
70 lines
2.3 KiB
Text
70 lines
2.3 KiB
Text
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
}
|
|
|
|
model DocketEntry {
|
|
id Int @id @default(autoincrement())
|
|
date DateTime @db.Date
|
|
title String @db.VarChar(500)
|
|
summary String @db.Text
|
|
notes String? @db.Text
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
// Relations
|
|
documents Document[]
|
|
|
|
@@map("docket_entries")
|
|
@@index([date(sort: Desc)], name: "idx_docket_entries_date")
|
|
}
|
|
|
|
model Document {
|
|
id Int @id @default(autoincrement())
|
|
docketEntryId Int @map("docket_entry_id")
|
|
title String @db.VarChar(500)
|
|
originalFilename String @map("original_filename") @db.VarChar(255)
|
|
storedFilename String @unique @map("stored_filename") @db.VarChar(255)
|
|
filePath String @map("file_path") @db.VarChar(500)
|
|
fileSize Int @map("file_size")
|
|
mimeType String @map("mime_type") @db.VarChar(100)
|
|
summary String? @db.Text
|
|
notes String? @db.Text
|
|
displayOrder Int @default(0) @map("display_order")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
// Relations
|
|
docketEntry DocketEntry @relation(fields: [docketEntryId], references: [id], onDelete: Cascade)
|
|
|
|
@@map("documents")
|
|
@@index([docketEntryId], name: "idx_documents_docket_entry")
|
|
@@index([docketEntryId, displayOrder], name: "idx_documents_display_order")
|
|
}
|
|
|
|
model Subscription {
|
|
id Int @id @default(autoincrement())
|
|
email String @unique @db.VarChar(255)
|
|
isActive Boolean @default(true) @map("is_active")
|
|
unsubscribeToken String @unique @map("unsubscribe_token") @db.VarChar(255)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
|
|
@@map("subscriptions")
|
|
@@index([isActive], name: "idx_subscriptions_active")
|
|
}
|
|
|
|
model AdminUser {
|
|
id Int @id @default(autoincrement())
|
|
username String @unique @db.VarChar(50)
|
|
passwordHash String @map("password_hash") @db.VarChar(255)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
lastLogin DateTime? @map("last_login")
|
|
|
|
@@map("admin_users")
|
|
}
|