generator client { provider = "prisma-client-js" output = "./generated/client" } datasource db { provider = "postgresql" url = env("DATABASE_URL") } model Account { id String @id user_id String type String provider String providerAccountId String refresh_token String? access_token String? expires_at Int? token_type String? scope String? id_token String? session_state String? User User @relation(fields: [user_id], references: [id], onDelete: Cascade) @@unique([provider, providerAccountId]) } model Session { id String @id sessionToken String @unique expires DateTime user_id String User User @relation(fields: [user_id], references: [id], onDelete: Cascade) } model User { id String @id name String? email String? @unique emailVerified DateTime? image String? full_name String password String? registration_id String? @unique Account Account[] Session Session[] active_ticket active_ticket[] chat_message chat_message[] closed_ticket closed_ticket[] } model VerificationToken { identifier String token String @unique expires DateTime @@unique([identifier, token]) } model active_ticket { id Int @id @default(autoincrement()) subject String category String user_id String opened_time DateTime @default(now()) hostel_block String? room_no String? contact_no String? chat_id Int body String chat_history chat_history @relation(fields: [chat_id], references: [id]) User User @relation(fields: [user_id], references: [id]) } model admin { id Int @id @default(autoincrement()) email String @unique full_name String password String employee_id String @unique } model chat_history { id Int @id @default(autoincrement()) active_ticket active_ticket[] chat_message chat_message[] closed_ticket closed_ticket[] } model chat_message { id Int @id @default(autoincrement()) chat_history_id Int body_text String sent_time DateTime @default(now()) user_id String? complaint_manager_id Int? chat_history chat_history @relation(fields: [chat_history_id], references: [id]) complaint_manager complaint_manager? @relation(fields: [complaint_manager_id], references: [id]) User User? @relation(fields: [user_id], references: [id]) } model closed_ticket { id Int @id @default(autoincrement()) subject String category String user_id String opened_time DateTime hostel_block String? room_no String? contact_no String? closed_time DateTime chat_id Int body String chat_history chat_history @relation(fields: [chat_id], references: [id]) User User @relation(fields: [user_id], references: [id]) } model complaint_manager { id Int @id @default(autoincrement()) email String @unique full_name String password String employee_id String @unique chat_message chat_message[] }