feat: Nambahin feature notifikasi
This commit is contained in:
@@ -27,6 +27,7 @@ model Admin {
|
||||
professional_bio String? @db.Text
|
||||
|
||||
projects Project[]
|
||||
notifications Notification[]
|
||||
|
||||
@@map("admin")
|
||||
}
|
||||
@@ -195,6 +196,7 @@ model User {
|
||||
project_members ProjectMember[]
|
||||
task_submissions TaskSubmission[]
|
||||
certificates Certificate[]
|
||||
notifications Notification[]
|
||||
|
||||
@@index([email])
|
||||
@@map("user")
|
||||
@@ -347,3 +349,20 @@ model Certificate {
|
||||
@@index([id_user], map: "certificate_id_user_foreign")
|
||||
@@map("certificate")
|
||||
}
|
||||
|
||||
model Notification {
|
||||
id Int @id @default(autoincrement())
|
||||
id_user Int? // For interns
|
||||
id_admin Int? // For mentors/admins
|
||||
title String @db.VarChar(255)
|
||||
message String @db.Text
|
||||
is_read Boolean @default(false)
|
||||
created_at DateTime @default(now())
|
||||
|
||||
user User? @relation(fields: [id_user], references: [id], onDelete: Cascade)
|
||||
admin Admin? @relation(fields: [id_admin], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([id_user])
|
||||
@@index([id_admin])
|
||||
@@map("notification")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user