feat: basic api setup and boilerplate
This commit is contained in:
100
backend/prisma/schema.prisma
Normal file
100
backend/prisma/schema.prisma
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
password String
|
||||
role String? @default("admin")
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Doctor {
|
||||
id Int @id @default(autoincrement())
|
||||
doctorId String @unique
|
||||
name String
|
||||
designation String?
|
||||
workingStatus String?
|
||||
qualification String?
|
||||
|
||||
departments DoctorDepartment[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
|
||||
model Department {
|
||||
id Int @id @default(autoincrement())
|
||||
departmentId String @unique
|
||||
name String
|
||||
|
||||
para1 String?
|
||||
para2 String?
|
||||
para3 String?
|
||||
facilities String?
|
||||
services String?
|
||||
|
||||
doctors DoctorDepartment[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model DoctorDepartment {
|
||||
id Int @id @default(autoincrement())
|
||||
|
||||
doctorId Int
|
||||
departmentId Int
|
||||
|
||||
doctor Doctor @relation(fields: [doctorId], references: [id])
|
||||
department Department @relation(fields: [departmentId], references: [id])
|
||||
|
||||
timing DoctorTiming?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([doctorId, departmentId])
|
||||
}
|
||||
|
||||
model DoctorTiming {
|
||||
id Int @id @default(autoincrement())
|
||||
|
||||
doctorDepartmentId Int @unique
|
||||
doctorDepartment DoctorDepartment @relation(fields: [doctorDepartmentId], references: [id])
|
||||
|
||||
monday String?
|
||||
tuesday String?
|
||||
wednesday String?
|
||||
thursday String?
|
||||
friday String?
|
||||
saturday String?
|
||||
sunday String?
|
||||
additional String?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
|
||||
model Blog {
|
||||
id Int @id @default(autoincrement())
|
||||
title String
|
||||
writer String?
|
||||
image String?
|
||||
content Json
|
||||
isActive Boolean @default(true)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
Reference in New Issue
Block a user